Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where is "Set as Startup" defined and persisted in C# winforms solutions?

I don't see it in the .sln file, which is what I expected.

like image 325
leora Avatar asked Dec 23 '22 12:12

leora


1 Answers

Which project is the "startup" project only has any relevance for debugging, which means it's user metadata from the point of the solution and the projects. Regardless of which project is the "startup" project, the compiled code is the same.

Because of this, the information is stored as a user setting in the Solution User Options file (solution.suo) which accompanies the Solution file (solution.sln). The .suo file "Records all of the options that you might associate with your solution so that each time you open it, it includes customizations that you have made" according to MSDN.

The .suo file is a binary file. If you want to read or change it programatically, you have to use IVsPersistSolutionOpts.LoadUserOptions from the Microsoft.VisualStudio.Shell.Interop namespace.

like image 171
bzlm Avatar answered Dec 31 '22 18:12

bzlm