调试时忽略Visual Studio中的项目 [英] Ignore a Project in Visual Studio while debugging

查看:302
本文介绍了调试时忽略Visual Studio中的项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Visual Studio中,如果您有一个包含许多项目的解决方案,是否可以指示调试器忽略某些项目?要将它们视为外部DLL?

In Visual Studio, if you have a solution with many projects, is it possible to instruct the debugger to ignore some of the projects? To treat them as external DLL's in that sense?

我们有很多我想调试的帮助程序代码.例如,如果我正在执行一个函数调用,并且步入该函数调用,那么我想跳过IoC代码和基类框架代码,并逐步研究我正在研究的类的内容.我想介绍的大多数内容都在支持程序集中.

We have a lot of helper code that I would like to debug around. For example, if I am at a function call, and I step into it, I would like to skip over IoC code, and base class framework code, and step into the meat of the classes I'm working on. Most of the stuff I'd like to step over are in support assemblies.

我希望避免卸载项目,因为其他团队成员正在积极地处理这些部分,并且我想在从源代码管理中获取最新信息时了解他们的更改.同样,出于相同的原因,我也不想设置替代解决方案.将调试器属性放在其他人的代码上也是不切实际的.

I would like to avoid unloading projects, since other team members are actively working on those parts, and I want to pick up their changes when I get latest from source control. Similarly, I don't want to set up an alternate solution for the same reason. It's also not practical to put debugger attributes on other people's code.

如果有一种方法可以指示VS我只对特定的组装感兴趣,那将是理想的选择.

If there is a way to instruct VS that I am only interested in particular assemblies, that would be ideal.

推荐答案

还有:)

工具->选项->调试->符号

Tools->Options->Debugging->Symbols

在右侧选项卡中将有一个选项,称为自动为以下项目加载符号".在其下,选择指定排除的模块"选项,然后在其中添加您的库名称.完成了.

There will be a option in the right side tab called "Automatically load symbols for:". Under that, select "Specify Excluded Modules" option and add your library name there. You're done.

此外,不要忘记设置工具"->选项"->调试"->常规"中的启动时没有用户代码警告"选项.取消选中警告是否在启动时没有用户代码"复选框.否则,Visual Studio将弹出一个烦人的消息框,提示没有可用的源代码.

Also, don't forget to set the "Warn if no user code on launch" option present in Tools->Options->Debugging->General. Untick the "Warn if no user code on launch" checkbox. Otherwise, visual studio will popup a annoying messagebox saying that no source code available.

值得指出的是,我上面解释的选项是从调试中排除某些程序集.反向也是可能的.如果要排除几个程序集,而只想调试一个或两个程序集,则可以使用同一菜单下的仅指定的模块"选项.工具->选项->调试->符号->自动为以下对象加载符号".与前面提到的选项相反,这只是将提到的符号单独加载以进行调试.

Worth noting that the option I explained above is to exclude some assemblies from debugging. Reverse is also possible. If you have several assemblies to exclude and only wanted to debug one or two assembles, you can use the "Only Specified Modules" option under the same menu. Tools->Options->Debugging->Symbols->"Automatically Load Symbols For:". On the contrary to aforementioned option, this just loads the mentioned symbols alone for debugging.

这篇关于调试时忽略Visual Studio中的项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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