Msbuild Stop On First Error
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack msbuild stoponfirstfailure Overflow the company Business Learn more about hiring developers or posting ads with us msbuild command line stop on error Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community msbuild continueonerror of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up stop solution build on first compilation\link error - msbuild up vote 0 down vote favorite I'm visual studio 2015 stop on first error compiling a solution with many projects inside using VS2013's MSBuild. I want the build to stop if one of the projects failes 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:Configuration=Release /p:ContinueOnError=false /p:StopOnFirstFailure=true but it doesn't work as I want it. Any suggestions? Thanks visual-studio compilation msbuild share|improve this
Msbuild Errorlevel
question asked Jul 16 '15 at 8:40 ItamarBe 1178 add a comment| 1 Answer 1 active oldest votes up vote 0 down vote The official documentation says StopOnFirstFailure: 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 setting BuildInParallel=false and see if that helps? Edit: Found an old blog post that says this might be easy to do if you're building a single .sln with multiple projects http://blogs.msdn.com/b/manishagarwal/archive/2006/05/09/593392.aspx share|improve this answer edited Jul 16 '15 at 13:23 answered Jul 16 '15 at 13:18 Techtwaddle 70069 add a comment| Your Answer draft saved draft discarded Sign up or log in Sign up using Google Sign up using Facebook Sign up using Email and Password Post as a guest Name Email Post as a guest Name Email discard By posting your answer, you agree to the privacy policy and terms of service. Not the answer you're looking for? Browse other questions tagged visual-studio compilation msbuild or ask your own question. asked 1 year ago viewed 482 times active 1 year ago Related 174Msbuild doesn't copy references (dlls) if using project dependencies in solution630Difference between Build Solution, Rebuild Solution, and Clean Solution
807969 Comments 10 Status Closed Workarounds 0 Type Bug Repros 0 Opened 11/7/2013 7:28:03 AM Access Restriction Public Description After Visual Studio 6 an annoying change was introduced: in multi-project solutions, the build continues
Msbuild Exit Code
even after one project has failed, regardless of dependencies. This makes little sense for many msbuild onerror people, since if project B depends on project A and the compilation of project A fails, what is the point of continuing? It build vision wastes time and makes it difficult to find the original error (i.e. the one that needs fixing) amongst all the bogus output. Worse, there is no option to change this behaviour. Many people have fixed this using http://stackoverflow.com/questions/31449330/stop-solution-build-on-first-compilation-link-error-msbuild a macro which hooks onto a build event, but when VCbuild is used (i.e. a solution is compiled via the command line) such macros have no effect. It would be a courtesy to give long-suffering Visual Studio users the option to return to VS6's common-sense approach. I apologise if this problem has been reported elsewhere, but I couldn't find any reference to it. DETAILS ATTACH A FILE EDIT THIS ITEM Assign To Item can only be https://connect.microsoft.com/VisualStudio/feedback/details/807969/no-option-to-stop-build-after-first-compilation-error reassigned when it is active. Comments (10) | Workarounds (0) | Attachments (0) Sign in to post a comment. Please enter a comment. Submit Posted by Edgars Batnya on 4/22/2016 at 1:05 AM It's very unfortunate that there's no option for this. This should have two modes: terminate build immediately on first error and terminate immediately after failed project is done.I do not understand the reasoning behind not including such options and it comes to me as no surprise why Microsoft is so slow to release anything. You are most probably wasting precious build server time gathering thousands of errors in the compile log, when instead you should have killed it and fixed that one error that caused 10000 others. It's all about the response and recovery time - not log correctness. If it takes 1 hour instead of 5 mins for an automated error report, then Microsoft is wasting their customer's time. Build some sort of log watchers and terminating MSBuild externally is not an option, as that would clutter the PCs with temporary files and corrupt project state because other 20 years old compiler quirks, which Microsoft probably refused to fix in the same fashion. Posted by David Pritchard on 1/27/2014 at 11:27 PM Not to mention the time wasted waiting for the continuous integration build to finish trying to compile ever
MSBuild Question 0 Sign https://social.msdn.microsoft.com/Forums/vstudio/en-US/1890b9a3-d805-464f-927e-2990098457f3/msbuild-task-stop-on-errors?forum=msbuild in to vote Hi there, i have been working on a huge MSBuild solution using custom task and many MSbuild projects (