Debug方式调试GAC中部署的程序

我们在调试GAC中部署的程序时候,很可能碰到下面的报告:

---------------------------
Microsoft Visual Studio
---------------------------
The following module was built either with optimizations enabled or without debug information:

C:/Windows/assembly/GAC_MSIL/CSDN.Community.TopicListDataCenter.EnterpriseComponents/2.5.1.23407__cdde601ea7585548/aaa.dll

To debug this module, change its project build configuration to Debug mode. To suppress this message, disable the 'Warn if no user code on launch' debugger option.
---------------------------
确定  
---------------------------

这是因为VS开发工具在C:/Windows/assembly/GAC_MSIL/CSDN.Community.TopicListDataCenter.EnterpriseComponents/目录下没有找到aaa.pdb调试符号文件。当然这个目录是GAC的目录,不可能有的。

如何解决,最笨的方法是吧 PDB 文件 Copy 到那个目录去。

我这里要说的解决方法当然不是这样的了。而是如下:

在Visual Studio 的调试属性中去掉 Enable Just My Code(Managed only)

这时候我们再去调试就不会出现上述提示文本了。也不会找不到 PDB文件了。一切都OK了。

我们在Modules窗口也可以看到成功加载了正确位置的pdb文件。

 

 

参考资料:

You Don't Need to Copy PDB Files to Debug in the GAC!
http://www.elumenotion.com/Blog/Lists/Posts/Post.aspx?ID=23

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值