Apply wininet dbg version to an app build with vs2008.

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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值