限制 Visual Studio 2010 调试第三方 DLL 文件 [英] Restrict Visual Studio 2010 from debugging third-party DLL files

查看:39
本文介绍了限制 Visual Studio 2010 调试第三方 DLL 文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

几天前,我为 Ninject DLL 启用了第三方调试来测试一些东西.现在我无法从 Ninject 源文件中分离调试器,因此代码正在步进(如果找不到源文件,则尝试步进)到 Ninject 源中.Telerik 源代码也发生了同样的问题.我在调试选项中选中了仅启用我的代码(仅受管)",但 Visual Studio 仍会进入第三方代码.如何只调试我的代码并避免进入第三方 DLL 文件?

Some days back, I had enabled third-party debugging for the Ninject DLL to test some things. Now I am unable to detach the debugger from the Ninject source files and because of that the code is stepping (trying to step if it could not find the source file) into the Ninject source. The same problem is happening for Telerik source code too. I have checked "Enable Just My Code (Managed Only)" in the debugging options, but the Visual Studio still steps into third-party code. How do I debug just my code and avoid stepping into the third-party DLL file?

推荐答案

不幸的是,JeffN825 的回答对我不起作用.

JeffN825's answer didn't work for me either unfortunately.

这样做了:

为您的可执行项目创建一个构建后步骤:

Create a post build step for your executable project:

在 Build Events > Post-build event 命令行下,添加以下脚本(替换为您的路径)以在创建后删除 pdb 文件:

Under Build Events > Post-build event command line, add the following script (replacing with your path) to remove the pdb files following their creation:

ECHO Y | DEL  $(SolutionDir)<MyProject>\bin\Ninject.pdb
ECHO Y | DEL  $(SolutionDir)<MyProject>\bin\Ninject.Web.Mvc.pdb

现在当我运行我的项目时,Ninject 代码没有被步进.

Now when I run my project, the Ninject code is not stepped into.

这篇关于限制 Visual Studio 2010 调试第三方 DLL 文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆