本文介绍了在第一个编译\链接错误时停止解决方案构建-msbuild的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用VS2013的MSBuild编译包含许多项目的解决方案.如果项目之一无法编译,并且希望msbuild的错误代码将为非零值,则表明构建失败,我希望构建停止.能做到吗

I'm compiling a solution with many projects inside using VS2013's MSBuild. I want the build to stop if one of the projects fails to compile and that the error code of msbuild will be non-zero to indicate something has failed. Can it be done?

我正在运行以下命令开始编译:

I am running this command to start compiling:

%MS_BUILD_PATH%%workarea%\ WindowsSolution.sln"/p:配置=发布/p:ContinueOnError = false/p:StopOnFirstFailure = true

%MS_BUILD_PATH% "%workarea%\WindowsSolution.sln" /p:Configuration=Release /p:ContinueOnError=false /p:StopOnFirstFailure=true

但是它不能按我的要求工作.有什么建议吗?

but it doesn't work as I want it. Any suggestions?

推荐答案

如果有人仍在Visual Studio中寻找此功能,则有一个免费扩展名为[VSColorOutput](此处),该选项可以停止在首次构建错误时停止构建.安装扩展程序后,这些选项位于:Tools.Options.VSColorOutput.Build Actions.Stop Build On First Error

If anyone is still looking for this feature in Visual Studio, there is a free extension called [VSColorOutput] (here), which has an option to stop the build on first build error. Once you have installed the extension, the options is located at: Tools.Options.VSColorOutput.Build Actions.Stop Build On First Error

这篇关于在第一个编译\链接错误时停止解决方案构建-msbuild的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-03 02:44