Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Run Debug mode from command line

I want to run my project in debug mode from the command line, not from Visual Studio (VS is open).

Is there any parameter to add to the command?

Actually, I want to initialize multiple instances of my project at the same time (from bat file) and debug them - instead of pressing multiple F5.

like image 364
yossharel Avatar asked May 18 '10 08:05

yossharel


1 Answers

For debugging multiple instances of your application you can launch them separately from the command line (or press Ctrl+F5 in VS to launch the application without debugger attached) and then attach the VS debugger manually using the Debug -> Attach to Process... menu command.

If you want to automatically launch/attach a debugger you could add the following code to your Main method:

#if DEBUG
    System.Diagnostics.Debugger.Launch();
#endif

This command should display the following dialog which allows you to choose the running instance for debugging:

Visual Studio Just-In-Time-Debugger

(i.e. Figure 7 in this article: http://msdn.microsoft.com/en-us/magazine/cc163606.aspx)

like image 76
Dirk Vollmar Avatar answered Oct 08 '22 21:10

Dirk Vollmar