Set Up Multiple Visual Studio StartUp Projects

What happens when you hit the “Start” button or hit F5 in Visual Studio? By default, the configured “StartUp Project” is launched in the debugger. If you never change anything, this will be the first executable project added to the solution. The startup project is highlighted in bold in the solution explorer:

single-start-up-project

To change the startup project, right-click the project that you’d like to set as the startup project and select “Set as StartUp Project”.

It is also possible to configure your solution to start up multiple projects simultaneously. This can be useful in situations where you have a couple projects in your solution that you want to test in tandem, such as a service and its UI. I am currently working on a visual “tail” UI for viewing log files, and in development it is useful to launch the UI and a program that generates a log file simultaneously. To set multiple startup projects, right-click the solution and select “Set StartUp Projects…” This launches the “StartUp Project” page in the solution’s property pages dialog (you can also get here by selecting “Properties” from the solution context menu). From this screen, select the “Multiple startup projects” radio button (“Single startup project” is selected by default), then use the grid to decide what action should be taken on each project, and in what order. To set a project to launch on startup, change the action to “Start” (note that “Start without debugging” is also an option, this is the equivalent of the default behavior when hitting Ctrl+F5). Use the arrow buttons on the right to change the order in which Visual Studio launches the projects.

multiple-start-up-projects

Finally, note that this screen also allows you to launch the “current selection” by default. This can also be useful in certain circumstances when you are bouncing between work in multiple executable projects in the same solution.

Hopefully learning to efficiently utilize this rather mundane and unexciting feature of Visual Studio will help you be incrementally more productive!

 
Comments

No comments yet.

Leave a Reply