12

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

Richard J. Ross III
  • 55,009
  • 24
  • 135
  • 201
sivabudh
  • 31,807
  • 63
  • 162
  • 228

2 Answers2

20

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
  • 868,454
  • 176
  • 1,908
  • 1,964
0

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
  • 5,033
  • 2
  • 37
  • 48