How to change the default debug Profile when launching multiple asp .NET core projects?

Viewed 2446

I have a solution that launches multiple projects, and I set the launch profile for both to the console app instead of launching in IIS via the Project Properties page.

When I launched the projects individually they launched successfully in the console windows. But when I set multiple startup projects they went back to launching in IIS.

How can I get multiple projects to launch using the correct debug profile?

2 Answers

To set the default launch profile you can re-arrange the debug profiles listed in Properties > launchSettings.json. The first profile in the list will be the one used when launching multiple projects.

enter image description here

As mentioned in the comment of the other answer, it doesn't seems to be true for VS2022. It does not automatically use the first entry in the launchSettings.json list.

You can change the starting project to a single one and switch the debug profile with the small arrow next to the play button in the toolbar one by one. But if you need to do a mass switch, I suggest doing a "search in all files", it's stored in the .csproj.user files:

<ActiveDebugProfile>Docker</ActiveDebugProfile>

Change them all, then reload your solution.

Related