Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Debug multiple copies of a program from one Visual Studio instance

I have a pre-alpha GUI program that I'm dogfooding and want to run under the debugger (for when things go wrong ;), but I don't want to have to launch a new copy of Visual Studio for each instance of the application. Can this be done?

I don't expect to actually be debugging more than one instance at a time, but I still want the debugger in the look for all of them. Also, I'm starting the application a few dozen time a day, so it would have to be easy to do.

like image 973
BCS Avatar asked Jan 15 '09 18:01

BCS


2 Answers

You can start an instance of the same, or different projects multiple times in one instance of Visual Studio. Here is how: Right click on any project in Solution Explorer, go to the Debug context menu item, and click Start new instance.

You can view and manipulate all your running processes from the Processes window (menu DebugWindowsProcesses). The menu item (and the Processes window) is only available when the application is running (under Visual Studio).

like image 148
Marcin Avatar answered Oct 19 '22 04:10

Marcin


This can be done.

If you have the Professional version of Visual Studio, you can use it to attach to each instance of the application that you have open.

First, compile the application with debug information so that it can actually be debugged.

Then launch your application. Open as many instances as you need.

In Visual Studio, click menu DebugAttach to Process.... Select the process(es) you want to debug. You can select more than one from the list by Shift + clicking or Ctrl + clicking them.

I've just tested this to make sure. One instance of Visual Studio (at least Visual Studio 2008) can debug multiple instances of the same application.

If you don't have the Professional version I don't think this can be done. I'm absolutely sure the Express version can not attach to processes. I'm not sure about what "paid" editions can attach to processes though it is possible to do.

like image 4
Dan Herbert Avatar answered Oct 19 '22 03:10

Dan Herbert