May 9, 2010 - To change this, just Right-Click a project in Solution Explorer. Alternatively, you could go to Project -> Set as StartUp Project to do the.
SlnStartupProject slnFilename projectName slnFilename: path to the Visual Studio solution file to modify projectName: Name of the project to set as the default StartUp project slnStartupProject searches slnFilename for a project called projectName and moves its definition at the top of the file. When Visual Studio opens a sln file for the first time, it sets the very first project as the startup project and then stores it in the associated.suo file. This often make the first build fail and forces the developer to locate the project, right-click on it and select 'Set as StartUp Project' for the build to succeed and launch. It is pretty annoying for maniacs like me. This becomes extremely relevant when you generate your solution using cmake as 3.5 and older always sets the dummy project ALLBUILD as the first project.
In CMake 3.6 and newer, there is now a property that allows the CMake author to specify the default startup project. You can now integrate slnStartupProject in your build script and make sure the projects you generate will build and launch everytime a developer hits F5 Hope this helps you.
Library slnStartupProject can also be used as a referenced library in your project to manipulate the startup project of a.sln file directly from a.NET program.