How to save startup projects configuration in VS 2019?

Viewed 457

We can set the multiple startup projects for a solution, if later we need to run only one project for X reason, the previous configuration is lost, and we have to manually select all the startup projects again. Is there any way to save that configuration or a workaround ? enter image description here

1 Answers

One option is that you can create a new solution for the situation where you want to run only the one project for X reason.

The new solution file can co-exist next to your current one just fine, but if you have any scripts running that expect only one solution you might have to adjust them.

For example, dotnet run might need to be changed to dotnet run original.sln

I use this technique for the case where I want to run unit tests against a library but the main solution has multiple target framework projects in it. This setup makes the unit test runners unhappy, but having a second solution file allows me to setup solution level configurations. In my case it means reducing what projects are in the solution and changing the startup project.

Related