How to stop C# compile on first error in VS 2010 (VS 2008 macros don't work)!

Posted by Ben Robbins on Stack Overflow See other posts from Stack Overflow or by Ben Robbins
Published on 2010-06-10T09:34:40Z Indexed on 2010/06/11 3:52 UTC
Read the original article Hit count: 227

Filed under:
|

At work we have a C# solution with over 80 projects. Is it possible in VS 2010 to automatically stop compilation as soon as an error is encountered rather than the default behaviour which is to continue as far as possible and display a list of errors in the error window?

I'm happy for it to stop either as soon as an error is encountered (file-level) or as soon as a project fails to build (project-level).

I'd also note that in VS 2008 we used macros similar to some of the answers below but they don't work in VS 2010 (at least I couldn't get them to as the environment events don't seem to fire in VS 2010).

© Stack Overflow or respective owner

Related posts about c#

Related posts about visual-studio-2010