Under Solution->Properties, I can set multiple start-up projects:
I know that I can get the list of projects marked with "Start" (by using EnvDTE: solution.SolutionBuild.StartupProjects
), but how do I get the list of projects whose action is "Start without debugging"? They do not appear in the list.
I don't think this is documented and available officially, but here are some information:
This is stored in the solution's .SUO file by the Visual Studio built-in package. The SUO file has the OLE compound storage format. You can browse it using a tool such as OpenMCDF (it has an explorer sample). In this file, you will see a stream named '
SolutionConfiguration
' that contains a dwStartupOpt token followed by the information you're looking for. The stream itself has a custom binary format.The same information is available from within VS through the IVsPersistSolutionProps Interface. You need to get a pointer to it from one of the loaded packages (for example enumerating the list of packages using the IVsShell.GetPackageEnum Method. One package will support the IVsPersistSolutionProps interface with the '
SolutionConfiguration
' stream.However, whatever method you choose, you will end up parsing the 'SolutionConfiguration' stream manually I believe. I present here a method that does it simply opening the SUO file and hacking the bits out 'manually', so it works outside of VS.
Here is the utility class that parses the 'SolutionConfiguration' stream:
Followed by a small compound stream read utility (no need for external library):
And the sample that display project guids associated with startup options: