views:

204

answers:

2

I have a single un-managed C++ console-app solution (.sln) with two projects (.vcproj) both are built as .exe. I want to run them both at the same time (one is a client and one is a server). How do I configure my Visual Studio such that when I hit a single button, say F5, it would be smart enough to run one after another, in the order that I specify?

Currently what I have to do is set one project to be a "Startup project" then hit "Ctrl+F5" to run one, then I have to change the "Startup project" to be the other one, then hit "Ctrl+F5".

Indeed, doing this 25 times a day is painful. =p

+14  A: 

Right-click on the solution in Solution Explorer, click Properties (If the window is blank, select the solution again), and go to the Startup Projects section under Common Properties. Select the Multiple Startup Projects option. Then, you can specify which project(s) to launch and whether each one should have the debugger attached. You can use the up and down arrows to change the launch order.

SLaks
It's "Multiple startup projects" radio-button. Order of execution can also be specified there.
Virne
Yes; I've expanded my answer.
SLaks
thank you. perfect answer.
ShaChris23
A: 

You could create a batch file that launches your two programs (possibly with a pause to let one start-up before the other comes in), and create a project yhat would launch this batch file when you press Ctrl-F5.

You would not have to change the active project any more, and you'd have full flexibility.

Xavier Nodet