When I change a web application project's Start Action (such as Current Page, Specific Page, Don't open a page, etc.) and save, Visual Studio doesn't store this selection in a file that is likely to get checked in to source control such as csproj
or sln
. Likewise, if I go to solution properties and select several multiple startup projects and save, this selection is not stored in such a file either. Is there a way I can store this info in files that will get checked in to source control rather than user settings files?

- 27,951
- 32
- 136
- 233
-
I think only an extension (vsix) could do this. Saving the current startup projects shouldn't be too difficult https://stackoverflow.com/questions/4262514/is-there-an-event-triggered-when-dte-solution-solutionbuild-startupprojects-changes but what would you do with that information? when? how? – Simon Mourier Jun 09 '18 at 07:30
-
Set those startup projects when the solution is loaded? – Jez Jun 09 '18 at 15:39
1 Answers
These configurations are stored in the Solution User Options (.suo) file and they are not meant to be stored in source control, Microsoft Documentations:
The solution user options (.suo) file contains per-user solution options. This file should not be checked in to source code control.
Startup Project, is a per user settings... a tester may want to set the test project for his startup while the developer wants the web project. The developer does not want his personal settings overwritten, every time he gets the latest version.
But, you can choose a default Startup Project, which would be used when there is no .suo file... to do this:
Open your solution file (.sln) in a text editor, you would see a list of your projects on top of this file, between Project
& EndProject
tags.
The first project in this list would become your default startup project, so you can reorder the project list and save your .sln file in source control.
Now if you delete your .suo file and reopen your solution in Visual Studio, the first project from the list becomes your startup project... and Visual Studio would create a new .suo file for you. I found this information on this stackoverflow post.

- 14,480
- 11
- 70
- 137
-
Kinda sucks if you ask me. I've had multiple solutions where it's appropriate to default to having multiple staartup projects, and each clone requires re-configuring that. The sln file should have a way of specifying default startup projects. – Jez Feb 16 '23 at 11:33