views:

272

answers:

4

I created a solution in Visual C# 2010 Express that contains two projects: one is the client, the other is the server. I would like to debug both at the same time, but I can only seem to run one of the projects during debugging.

Is there a way to run both at once?

+2  A: 

You may find it easiest to just use two instances of Visual Studio. You could make a solution with just the server project in it, so that you can set the startup project separately for each solution

Mark Heath
+14  A: 

Go to Solution properties -> Common properties -> Startup Project and select Multiple startup projects

Max
Bingo! Thank you!
Tim Cooper
You're welcome.
Max
WOW, I have always opened two instances of Visual Studio to accomplish this (which was annoying). Now I feel quite stupid!
Dan Tao
Better to keep your mouth shut and let us wonder... than to admit and let all doubt disappear. (I keed I keed. I didn't know either. Good call sir :)
WernerCD
BTW. Projects can also be started for debugging from Solution Explorer. In Solution Explorer right click on the project, then Debug-> Start new Instance. So with one instance of VS one can debug loads of instances at once.
Max
+1  A: 

Max nailed it. I have a post here that shows some screenshots for those interested: http://blogs.msdn.com/b/zainnab/archive/2010/05/10/multiple-startup-projects-vstipenv0015.aspx

zainnab
+2  A: 

Max has the best solution for when you always want to start both projects, but you can also right click a project and choose Debug > Start New Instance.

This is an option when you only occasionally need to start the second project or when you need to delay the start of the second project (maybe the server needs to get up and running before the client tries to connect, or something).

Iceman