Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ignore a Project in Visual Studio while debugging

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?

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.

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

like image 792
Craig Celeste Avatar asked Apr 21 '15 18:04

Craig Celeste


1 Answers

Well there is :)

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.

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.

like image 105
Sriram Sakthivel Avatar answered Oct 21 '22 06:10

Sriram Sakthivel