Visual Studio: debug multiple projects at once?

Can I debug multiple projects at the same time in Visual Studio?

I know that you can select multiple launch projects from solution properties, but how are breakpoints handled?

If two projects use the same class (two different instances of it) and I am stopped with a breakpoint in it, will it block only one program or both? How can I find out which executable gets to the breakpoint? I am a bit confused.

+14
source share
2 answers

Yes it is possible. You can install several startup projects in your solution (right-click the solution, go to the "Installing startup projects" section, select "Multiple startup projects") and specify the action for each project contained in the solution ("No", "Start" , "Starting without debugging"). If several projects are set to "Start", the debugger will connect to each at startup.

When you reach the breakpoint, you can see which process is used in the Debug toolbar (you may need to show it; some profiles hide this by default). It will show which process you are currently viewing, what thread you are in, and what frame frame you are in:

Debug Location toolbar

I believe the default behavior is that when one process is interrupted, the debugger interrupts them all. This way you can check the status of any attached process when it reaches one breakpoint.

+25
source

No. You can debug the EXE file and go to the debug version of the associated DLL file if you are sure that the EXE file "sees" the same DLL file as the debugger, but you cannot debug two EXE files. files at the same time. At least as far as I know.

0
source

Source: https://habr.com/ru/post/1240596/


All Articles