Multi-Project Configuration in Visual Studio

The new Visual Studio 2022 update with version number 17.9.0 was released recently. The release comes with a couple enhancements, including changes in the document well and non-modal debug visualizers. But my favorite new feature is the multi-project configuration which allows us to manage startup profiles. The feature is not mentioned in the “What’s new?” dialog in Visual Studio and is easy to overlook, so I provide some additional information.

What is the feature for?

In modern solutions, there are often several projects to start. Previously, it was already possible to start multiple projects together, but it was not possible to share the profile or store more than one configuration. This new feature finally allows us to store these profiles in a file that can be shared.

How to configure the profiles?

The profiles are configured via the “Configure Startup Profiles” dialog:

Configure Startup Profiles dialog

It is possible to create and name profiles and select the action for each project. The debug targets come from the launchSettings.json which is known from asp.net core projects but is also useable in console applications. If the project doesn’t have a launchSettings.json the project is started without a special configuration.

The profiles are stored in a new .slnLaunch file which is placed in the solution directory and should be checked in to the source control. This is a simple json file. Profiles without an active “Share profile” checkbox on the bottom are stored in a .slnLaunch.user file. This file has the same structure like a regular .slnLaunch file but usually *.user files are excluded from source control (.gitignore) and are therefore not shared with team members.

How to choose a profile?

Well, that’s the big question...

I would have expected it in the “Startup Projects” dropdown in the toolbar, but only the individual projects are still listed there. Even the unit test projects are included, which are not executed in this way anyway.

Startup Projects list in toolbar

The solution is to go back to the “Configure Startup Profiles” dialog, select the desired profile and click on “Apply”. To find out which profile is active at the moment, open the dialog again. The selected item in the list is the active profile.

The selection is not very convenient and not obvious, but it works. Somone already created an issue in the Visual Studio Developer Community, which can be upvoted.

Conclusion

A few improvements could still be made, but we finally have a feature to manage startup profiles in Visual Studio. The profiles are even shareable with team members, which is nice.