zoukankan      html  css  js  c++  java
  • 怎么让Visual Studiot在遇到一个project编译错误时停止编译其它project

    Visual studio一个solution中含有多个project时,当编译整个solution,如果一个project编译出错,visual studio会继续编译其它的project,这在大多数情况下都是不需要的,只是浪费了时间。
    StopOnFirstBuildError extension是一个Visual Studio2012 和2010的插件,可以让Visual Studiot在遇到一个project编译错误时停止编译其它project。对于2008,可以用Stop that Build! Don't waste time building projects in Visual Studio的方法。
    打开菜单:Tools->Macros->Macros IDE,双击"MyMacros",在EnviromentEvents中加入如下代码:
        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

            '-- When the build of a project fails
            If (Not Success) Then

                '-- Cancel the remaining builds in the Solution
                DTE.ExecuteCommand("Build.Cancel")

                '-- Write a polite message to the OutputWindow that's logging all information about this build
                DTE.ToolWindows.OutputWindow.ActivePane.OutputString(vbCrLf & vbCrLf & "Build failed while compiling " & Project)


            End If

        End Sub


  • 相关阅读:
    部署nginx服务
    mysql主从配置
    LNMP+WordPress博客搭建
    CIFS(Samba)服务的使用
    NFS服务的使用
    LVM逻辑卷
    FTP学习
    文件处理+生成器
    内置函数
    Python3
  • 原文地址:https://www.cnblogs.com/fresky/p/2871961.html
Copyright © 2011-2022 走看看