Starting Multiple Projects at Once in Visual Studio

Visual Studio offers a simple way to change the project that gets started when you click on Start or hit F5. All you need to do is to select the project in the Solution Explorer, right-click on the name and select the option “Set as StartUp Project“:

This works well when you want to start just one project in a solution. Starting multiple projects at the same time needs a different approach and this post shows you two options you can use.

 

Startup projects in the solution properties

You can select multiple startup projects in the solution properties. Go to the Solution Explorer, right-click on the name of your solution and select the option “Set StartUp Projects…“:

The settings dialog offers you all the possible combinations to start projects in your solution. You can keep everything as it is, change a single startup project or use multiple startup projects.

In this example we select the “Multiple startup projects” option. For each project you can specify exactly how it should be started. You can ignore the project by selection the option none, or you can start the project with or without using the debugging mode.

When you have set your startup projects, click on OK to save the changes. Whenever you now hit F5 those projects are started together.

The built-in option works well when you need to start multiple projects only from time to time. If this gets a daily task and you work in a team where everyone needs to start the same projects, then you should try the SwitchStartupProject extension.

 

The SwitchStartupProject extension

Especially when you work with distributed systems you most often need to start multiple projects at once. Not only do you need to setup the start projects, but so do all your teammates. It can be done with the built-in option, but there is a better approach: the SwitchStartupProject extension.

You can install the extension using the extension manager of Visual Studio. You find it in Tools / Extensions and Updates. Search for SwitchStartupProject and click on download. The installation will start as soon as you restart Visual Studio.

This extension changes the user interface of Visual Studio and offers a direct way to switch between projects to start:

This helps you to quickly change the project to start, but it has an even more helpful feature: you can save the configuration of your startup projects in version control. In the dropdown on the left side are not only the different projects to select, but also an entry called Exercise:

If you select this entry, the startup configuration starts all projects that are associated with this configuration. You can change the configuration by clicking on Configure… in the same menu. It opens up a JSON file (YourSolution.sln.startup.json) where you can change the configuration to your needs (including command line arguments):

 

Conclusion

Starting a different project or multiple projects at once is a simple task in Visual Studio. If you work in a more complex environment, the extension SwitchStartupProject is a good helper to manage your startup projects.

3 thoughts on “Starting Multiple Projects at Once in Visual Studio”

  1. This is an mus have extension for solutions with multiple projects under multiple configurations like Docker/console/IIS.

    Reply
    • Hi Eric,
      I am not aware of a way to run the same project multiple times.

      Regards,
      Johnny

      Reply

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.