A large number of solutions have a single startup project and multiple library projects. Every time I get a clean copy of such a solution from source control Visual Studio seemingly sets a random project as the startup project. Which you can guarantee is never the actual startup project. Then you press F5 and obviously VS has a little whinge say you as it can't start a .dll.
This has beena big bear for years. Especially with large solutions, where you then have to scroll through the Solution Explorer to find and set the startup project.
It works be cool if VS could make a pretty sensible guess at the correct startup project for the majority of solutions.
I'm wondering aloud if we could be smarter around this by;
The first added project in a a solution is the startup project (by default).
@davkean It would be nice that the "default" startup project(s) could be saved into the solution file, so these default settings can be shared (as the solution file is checked in to source control).
@davkean, I think there are a few properties that could be used to help make a "better" guess.
The code that the SDK currently uses for related logic is basically this: https://github.com/dotnet/sdk/commit/61f90dfd32605862d457d1f6e5b73a3ca3099217
We use two properties _IsExecutable and HasRuntimeOutput to control most of our logic. With those defaulting to true if the OutputType is Exe or WinExe.
@Styxxy The default can be saved. The first project that is listed in the sln file is the default.
@Pilchie Yes, but not multiple :-).
I'd love the solution file contained the definition of the startup project.
After all, we're getting a new solution file format, right? One that makes sense, right? Right?
It'd be great if we could set several default startup projects.