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 righ
Here is the the way to solve problem related to Mahin's macro
Problem description: 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.
Public Module Custom
Private WithEvents t As Timers.Timer
Private Prop As EnvDTE.Property
Private PrevStartup As Object
Private Sub StartTimer()
t = New Timers.Timer
t.Interval = 0.05
t.Start()
End Sub
Sub t_Elapsed(ByVal ee As Object, ByVal dd As Timers.ElapsedEventArgs) Handles t.Elapsed
If DTE.Solution.SolutionBuild.BuildState <> vsBuildState.vsBuildStateInProgress Then
t.Stop()
Prop.Value = PrevStartup
End If
End Sub
Sub RunSelectedWithoutDebug()
Dim Projs As Array
Dim Proj As Project
Projs = DTE.ActiveSolutionProjects()
If (Projs.Length > 0) Then
Proj = Projs.GetValue(0)
Prop = DTE.Solution.Properties.Item("StartupProject")
PrevStartup = Prop.Value
Prop.Value = Proj.Name
DTE.ExecuteCommand("Debug.StartWithoutDebugging")
StartTimer()
End If
End Sub
End Module
Enjoy !