Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

New information:
This question has been re-asked here and has been correctly answered by Noah Richards with a solution that works in VS 2010.

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).

Also Somewhat Related:
How to automatically stop Visual C++ build at first compile error?

like image 975
Ben Robbins Avatar asked Jun 10 '10 09:06

Ben Robbins


People also ask

How do I stop a C program?

So the C family has three ways to end the program: exit(), return, and final closing brace.

What does exit () do in C?

In the C Programming Language, the exit function calls all functions registered with atexit and terminates the program. File buffers are flushed, streams are closed, and temporary files are deleted.

How do you stop an infinite loop in C?

If you were executing the while(1) loop in the main function, return would immediately exit main function, which means it will quit the program and exit the infinite loop as well.


1 Answers

This question got closed as a duplicate so I re-asked it and it has been correctly answered by Noah Richards.

See this question VS2010 - How to automatically stop compile on first compile error for a solution that works in VS 2010.

like image 158
Ben Robbins Avatar answered Nov 14 '22 22:11

Ben Robbins