代码之家  ›  专栏  ›  技术社区  ›  nickd

VS 2008中的解决方案级构建事件

  •  3
  • nickd  · 技术社区  · 17 年前

    解决方案属性页上没有构建事件,我该怎么办?

    1 回复  |  直到 17 年前
        1
  •  3
  •   Praveen Angyan    17 年前

    在那里,双击EnvironmentEvents模块并添加以下代码:

    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 Solutions\Solution1.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 Solutions\Solution1.sln")
               //Do whatever you need for Solution1.sln here.
            End If
        End If
    End Sub