C# Source Code: Automatically cancelling a failed build in Visual Studio
[
Home
|
Contents
|
Search
|
Reply
| Previous | Next ]
C# Source Code
Automatically cancelling a failed build in Visual Studio
By:
Grant Drake
Email (spam proof):
Email the originator of this post
Date:
Tuesday, July 18, 2006
Hits:
2328
Category:
General/Framework
Article:
One of the annoying things with VS.NET is that if you choose to do a build and an error occurs way up the "build tree", VS.Net will continue to try and build all the child projects with the inevitable disastrous results of missing assemblies and a giant mess in your task window. Add this macro to your "EnvironmentEvents" module in your Macros IDE (Tools->Macros->Macro IDE) Option Strict Off Option Explicit Off Imports EnvDTE Imports System.Diagnostics Public Module EnvironmentEvents #Region "Automatically generated code, do not modify" 'Automatically generated code, do not modify 'Event Sources Begin
Public WithEvents DTEEvents As EnvDTE.DTEEvents
Public WithEvents DocumentEvents As EnvDTE.DocumentEvents
Public WithEvents WindowEvents As EnvDTE.WindowEvents
Public WithEvents TaskListEvents As EnvDTE.TaskListEvents
Public WithEvents FindEvents As EnvDTE.FindEvents
Public WithEvents OutputWindowEvents As EnvDTE.OutputWindowEvents
Public WithEvents SelectionEvents As EnvDTE.SelectionEvents
Public WithEvents BuildEvents As EnvDTE.BuildEvents
Public WithEvents SolutionEvents As EnvDTE.SolutionEvents
Public WithEvents SolutionItemsEvents As EnvDTE.ProjectItemsEvents
Public WithEvents MiscFilesEvents As EnvDTE.ProjectItemsEvents
Public WithEvents DebuggerEvents As EnvDTE.DebuggerEvents 'Event Sources End 'End of automatically generated code #End Region 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 Not Success Then 'The build failed...cancel any further builds. DTE.ExecuteCommand("Build.Cancel") End If End Sub End Module
Terms and Conditions
Support this site
Download a trial version of the best FTP application on the internet