Thursday, August 18, 2011

Visual Studio: Setting multiple startup projects via macro

UPDATE: For Visual Studio 2010 (and later?) see http://tom.paschenda.org/blog/?p=44.

According to the documentation, this should work: Sub StartUpProj() Dim sb As SolutionBuild = DTE.Solution.SolutionBuild Dim startupProjects() As String = { "Project1.vcproj", "Project2.vcproj" } sb.StartupProjects = startupProjects End Sub Unfortunately, it also says in the MSDN here:

The StartupProjects collection in the current version of Visual Studio .NET allows you to set only a single startup project, but future versions will allow multiple startup projects.
This was written for Visual Studio .NET 2003 and still holds true for Visual Studio 2008. At least this works for setting a single startup project: Sub StartUpProj() Dim sb As SolutionBuild = DTE.Solution.SolutionBuild sb.StartupProjects = "Project1.vcproj" End Sub BTW: Above examples are for C/C++ projects. For other types of projects the extensions vary.

2 comments:

  1. Hi Matthias!

    Thanks yor your post.
    In Visual Studio 2010, multiple startup projects are indeed possible. One needs to really use the right types though.
    I 've summarized my findings here:
    http://tom.paschenda.org/blog/?p=44

    Regards
    Tom

    ReplyDelete