停止解决方案构建第一次编译\链接错误 - msbuild

时间:2015-07-16 08:40:45

标签: visual-studio compilation msbuild

我正在使用VS2013的MSBuild编写一个包含许多项目的解决方案。如果其中一个项目无法编译并且msbuild的错误代码将为非零以指示某些内容失败,我希望构建停止。可以吗?

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

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

但它不能按我的意愿运作。有什么建议吗?

2 个答案:

答案 0 :(得分:4)

如果有人仍在Visual Studio中查找此功能,则会有一个名为[VSColorOutput]here)的免费扩展程序,它可以选择停止第一次构建错误的构建。安装扩展程序后,选项位于:Tools.Options.VSColorOutput.Build Actions.Stop Build On First Error

答案 1 :(得分:2)

the MDN documentationStopOnFirstFailure: If true, when one of the projects fails to build, no more projects will be built. Currently this is not supported when building in parallel (with multiple processors).

您可以尝试设置BuildInParallel=false并查看是否有帮助吗?

编辑:找到一篇旧帖子,上面写道,如果您要构建包含多个项目的单个.sln official documentation

,这可能很容易做到
相关问题