I wrote a Macro for my own project as I needed this exact functionality:
You can write a Macro that does this for you. Go to Tools -> Macros IDE
Once there, double click on the EnvironmentEvents module and add this code:
Private Sub BuildEvents_OnBuildBegin(ByVal Scope As EnvDTE.vsBuildScope, ByVal Action As EnvDTE.vsBuildAction) Handles BuildEvents.OnBuildBegin
If (Scope = EnvDTE.vsBuildScope.vsBuildScopeSolution)
//Do whatever solution independent stuff you need here.
If(DTE.Solution.FullName = "C:My SolutionsSolution1.sln")
//Do whatever you need for Solution1.sln here.
End If
End If
End Sub
Private Sub BuildEvents_OnBuildDone(ByVal Scope As EnvDTE.vsBuildScope, ByVal Action As EnvDTE.vsBuildAction) Handles BuildEvents.OnBuildDone
If (Scope = EnvDTE.vsBuildScope.vsBuildScopeSolution)
//Do whatever solution independent stuff you need here.
If(DTE.Solution.FullName = "C:My SolutionsSolution1.sln")
//Do whatever you need for Solution1.sln here.
End If
End If
End Sub
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…