Multiple Startup Projects

Keyboard:  ALT + ENTER
Menu:  Project -> Properties [with Solution Selected in Solution Explorer]; [Right-Click the solution in Solution Explorer] -> Properties
Versions:  2008,2010
Published:  5/10/2010
Code:  vstipEnv0015

 

We work with multiple projects all the time.  Take the classic Server / Client scenario:

image

 

I want both of these projects to start up when I press F5.  How do I do it?  Easy!  Just click the solution in Solution Explorer and then click the Properties button at the top:

image

 

Make sure you are in the Common Properties -> Startup Project area and you should get a dialog similar to this:

image

 

Notice that, currently, the setting is on "Single startup project" but that isn't what we want.  Instead choose "Multiple startup projects":

image

 

Now we need to indicate what Action we want each project to take when we press F5:

image

 

There are essentially three choices:

None - don't start.

Start - start with debugging.

Start without debugging - self explanatory.

 

In our example, let's choose "Start" for both projects:

image

 

There's just one little problem:  the "Client" project is starting first.  We want the "Server" to start first then the "Client".  To do this we use the buttons to the far right of the project list:

image

 

These will move the projects around so you can have them start in the order you would like.  Select the "Server" project and then click the Move button to move it up in the order:

image

 

Now we are all set!  When you press F5 you will see both projects start.  One interesting side effect of doing multiple startup projects is that the bold project name you normally see in Solution Explorer isn't there BECAUSE there are more than one startup projects:

image