2009-11-04 71 views
0

我加了這個有據可查的宏MyMacros,在VS 2008個宏環境活動,以消除構建失敗:Visual Studio 2008中BuildEvent宏不點火

Private Sub BuildEvents_OnBuildProjConfigDone(ByVal Project As String, ByVal ProjectConfig As String, ByVal Platform As String, ByVal SolutionConfig As String, ByVal Success As Boolean) Handles BuildEvents.OnBuildProjConfigDone 

    If Success = False Then 
     'The build failed...cancel any further builds. 
     DTE.ExecuteCommand("Build.Cancel") 
    End If 

但它不取消我的構建。我也設置了斷點,希望能夠觸發它,但它們也沒有被擊中。

我也加入本次測試的宏,但它不是被解僱或者:

Private Sub BuildEvents_OnBuildBegin(ByVal Scope As EnvDTE.vsBuildScope, ByVal Action As EnvDTE.vsBuildAction) Handles BuildEvents.OnBuildBegin 
    Beep() 
    Beep() 
End Sub 

「允許宏運行」選項設置。

爲什麼它不被解僱?爲什麼我的breakponts沒有被擊中?

感謝您的幫助

回答

1

顯然,你必須運行在宏IDE調試(綠色播放按鈕)被擊中斷點。

現在我知道了。