Stop solution based on first compilation \ link error - msbuild

I am building a solution with many projects inside using VS2013 MSBuild. I want the build to stop if one of the projects fails to compile and that the msbuild error code will be nonzero to indicate that something failed. It can be done?

I run this command to start compiling:

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

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

+4


source to share


3 answers


If anyone is still looking for this feature in Visual Studio, there is a free extension called [VSColorOutput]

( here ) that has the option to stop the build on the first build error. Once you've installed the extension, the options are located at:Tools.Options.VSColorOutput.Build Actions.Stop Build On First Error



+4


source


Official documentation saysStopOnFirstFailure: 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).

Can you try installing BuildInParallel=false

and see if that helps?



Edit: Found an old blog post that says this can be easily done if you create one .sln with multiple projects http://blogs.msdn.com/b/manishagarwal/archive/2006/05/09/ 593392.aspx

+2


source


I am using StopOnFirstBuildError

https://marketplace.visualstudio.com/items?itemName=EinarEgilsson.StopOnFirstBuildError

It stops the build when any project fails. I am using in 2015. The linked page says it works with Visual Studio 2012, 2013, 2015, 2017.

0


source







All Articles