Apply wininet dbg version to an app build with vs2008.
2009-07-29 09:48
453 查看
keyword: wininet.dll urlmon.dll debug version iexplore.exe.local Microsoft.VC90.ATL.manifest Microsoft.VC90.CRT.manifest msvcr90.dll atl90.dll
在 side-by-side component 之前, 运用 Dynamic-Link Library Redirection, 你可以很容易的使用 wininet.dll/urlmon.dll 的 debug 版来调试程序. 只需要在程序(app.exe) 所在的目录创建一个 app.exe.local, 然后把 debug 版的 wininet.dll 放到这个目录, 设置环境变量 SET WININETLOG=1, 运行程序就能生成一个 wininet log 文件了.
但如果你的程序是 vs2008 编译的, 就会发现这个方法不好使了. Ref[2] 中提到这么一句.
"If the application has a manifest, then any .local files are ignored."
要想让你的 vs2008 编译的新程序也能使用 debug 版的 wininet.dll. 你必须使用 manifest 文件. 将下面的 code 保存为 wininet.dbg.manifest:
注意其中的版本号, 要和你的 debug wininet.dll 的版本一致. 注意 assemblyIdentity 中的 name 属性. file 节点在这里是必须的. 指定是哪个 dll.
在你的程序的代码这加入下面这段:
注意, name 属性 wininet.dbg 要和上面的 xml 文件中的 assemblyIdentity name 属性保持一致. 并且和 wininet.dbg.manifest 的文件名保持一致. 三个地方出现的 wininet.dbg 可以替换成任意字符串, 除了 wininet
在测试这个 manifest 文件的时候, process monitor 帮了很大的忙.
Reference:
1. How to use the debug version of the Wininet.dll file for Internet Explorer
http://support.microsoft.com/kb/884931
2. Dynamic-Link Library Redirection
http://msdn.microsoft.com/en-us/library/ms682600(VS.85).aspx
3. Isolated Applications and Side-by-side Assemblies
http://msdn.microsoft.com/en-us/library/aa375193(VS.85).aspx
在 side-by-side component 之前, 运用 Dynamic-Link Library Redirection, 你可以很容易的使用 wininet.dll/urlmon.dll 的 debug 版来调试程序. 只需要在程序(app.exe) 所在的目录创建一个 app.exe.local, 然后把 debug 版的 wininet.dll 放到这个目录, 设置环境变量 SET WININETLOG=1, 运行程序就能生成一个 wininet log 文件了.
但如果你的程序是 vs2008 编译的, 就会发现这个方法不好使了. Ref[2] 中提到这么一句.
"If the application has a manifest, then any .local files are ignored."
要想让你的 vs2008 编译的新程序也能使用 debug 版的 wininet.dll. 你必须使用 manifest 文件. 将下面的 code 保存为 wininet.dbg.manifest:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> <noInheritable></noInheritable> <assemblyIdentity type="win32" name="wininet.dbg" version="6.0.2900.2180" processorArchitecture="x86" ></assemblyIdentity> <file name="wininet.dll" /> </assembly>
注意其中的版本号, 要和你的 debug wininet.dll 的版本一致. 注意 assemblyIdentity 中的 name 属性. file 节点在这里是必须的. 指定是哪个 dll.
在你的程序的代码这加入下面这段:
#pragma comment(linker, "/manifestdependency:/"type='win32' name='wininet.dbg' version='6.0.2900.2180' processorArchitecture='x86' language='*'/"")
注意, name 属性 wininet.dbg 要和上面的 xml 文件中的 assemblyIdentity name 属性保持一致. 并且和 wininet.dbg.manifest 的文件名保持一致. 三个地方出现的 wininet.dbg 可以替换成任意字符串, 除了 wininet
在测试这个 manifest 文件的时候, process monitor 帮了很大的忙.
Reference:
1. How to use the debug version of the Wininet.dll file for Internet Explorer
http://support.microsoft.com/kb/884931
2. Dynamic-Link Library Redirection
http://msdn.microsoft.com/en-us/library/ms682600(VS.85).aspx
3. Isolated Applications and Side-by-side Assemblies
http://msdn.microsoft.com/en-us/library/aa375193(VS.85).aspx
相关文章推荐
- A tutorial that will show you how to build an instant messaging app with Sinch.
- How to build a mobile app with an App Engine backend
- Android NDK: Your APP_BUILD_SCRIPT points to an unknown file: C:\android-ndk/jni /Android.mk
- Android:Your APP_BUILD_SCRIPT points to an unknown file
- This app has been built with an incorrect configuration. Please configure your build for VectorDrawa
- This app has been built with an incorrect configuration. Please configure your build for VectorDra
- You are attempting to build with the incorrect version of java.
- How to build Multi-Language Web Sites with ASP.NET 2.0 and VS.Net 2005
- You are attempting to build with the incorrect version of java.
- Diffrent ways to travers buildetails of a build definition with vs 2005 and vs 2008
- pod install后出现: [!] `<PBXResourcesBuildPhase UUID=`x`>` attempted to initialize an object with an...
- You are attempting to build with the incorrect version of java
- How to build Multi-Language Web Sites with ASP.NET 2.0 and VS.Net 2005
- How to Make an iOS VoIP App With Pjsip: Part 2
- This app has been built with an incorrect configuration. Please configure your build for VectorDrawa
- This app has been built with an incorrect configuration. Please configure your build for VectorDrawa
- You are attempting to build with the incorrect version of java.
- How to Build an Android Project with Eclipse
- How to Make an iOS VoIP App With Pjsip: Part 4
- This app has been built with an incorrect configuration. Please configure your build for VectorDrawa