C# – Why is “Set as Startup” option stored in the suo file and not the sln file

cvisual studio

It seems like this setting should be stored in the solution file so it's shared across all users and part of source code control. Since we don't check in the suo file, each user has to set this separately which seems strange.

Best Answer

It is absolutely necessary that everyone can define their StartUp Project themselves, as Jon has already said. But to have a dedicated default one would be great, and as I can tell, it is possible!

If you don’t have a .suo file in your solution directory, Visual Studio picks the first project in your .sln file as the default startup project.

  1. Close your Visual Studio and open the .sln file in your favorite text editor. Starting in line 4, you see all your projects encapsulated in ProjectEndProject lines.

  2. Cut and paste the desired default startup project to the top position.

  3. Delete your .suo file.

  4. Open your solution in Visual Studio. Ta daa!