How to start a single project without debugging in Visual Studio?

My solution contains multiple projects which can be started. SometimesI would like to start a single project without using my solution startup projects settings. When I right-click on the project, I can navigate to Debug->Start New Instance, which starts the application with debugger.

But I would like to start a new instance without debugger. Is this possible?


Maybe this is new in VS 2015 but there's no need to add a custom macro - you can find the Start Without Debugging menu item in the list of things you can add.

Go to Tools -> Customize, follow the images below.

Hit Add Command Here you can find the menu item


If you are interested in permanent solution then I have written a small macro for this task. It does following things :

  1. Gets current selected project ( it will use first selected project, if you have selected multiple projects.)
  2. Saves the current Startup Project
  3. Sets the current selected project as Startup project and Runs the current selected project in "Start without Debug" Mode.
  4. Restores the Initial Startup Project as Startup Project.

Below is the Macro that I have written and the procedure how to do it.

How to write Macro : First thing you need to go to Visual Studio Tools --> Macros --> Macro Explorer. Once you got that right click on MyMacros and create a new module (I called it CollapseAll).

Now edit the new module (double-click on it) erase whatever is in there and paste this stuff into it.

Sub RunSelectedWithoutDebug()
            Dim Projs As Array
            Dim Proj As Project
            Projs = DTE.ActiveSolutionProjects()
            If (Projs.Length > 0) Then
                Proj = Projs.GetValue(0)
                Dim Prop As EnvDTE.Property
                Prop = DTE.Solution.Properties.Item("StartupProject")
                Dim PrevStartup As Object
                PrevStartup = Prop.Value
                Prop.Value = Proj.Name
                DTE.ExecuteCommand("Debug.StartWithoutDebugging")
                Prop.Value = PrevStartup
            End If
        End Sub

How to bind macro to keyboard shortcut : To do this you need to go to Tools-->Options-->Environment-->Keyboard. Pick your macro from the listBox with all the default VS stuff (remember it will be there like MyMacros.Module1.RunSelectedWithoutDebug) and then assign a hotkey combination or chord to it and save.

Note : Fourth step is creating a problem and spawns an annoying messagebox saying : The build must be stopped to change the solution property. Stop the build? Ok or Cancel. I used to hit Ok for the timebeing. If you dont have any problem if the macro sets up current selected project as Startup project than please comment last line of macro Prop.Value = PrevStartup by putting ' at the start of line.Now the messagebox will not come.

I am looking into it and will post the updated macro once i solve it ( if I can :) )


Add VSCommands extension into Visual Studio, right click a project -> Debug -> Start Without Debugging