c# - VS2010 - How to automatically stop compile on first compile error -


{rant} First of all I would like to say that this is not a duplicate I asked this question first It is, but when it is not, it is closed as a duplicate. This question VS 2010 and respond to the so-called duplicate work in VS 2008, but not in VS 2010 (at least for me or none). So before you stop something as a duplicate, read about the question about yourself carefully and try answer for yourself and see if it actually Works in or not. Sorry for the rant but there is no clear way to contact the SO Police, who stops this issue or it is opened again. {/ Rant}


At work we have a C # solution with 80 projects. In VS 2008 we use a macro to prevent compilation as soon as the solution is to build a project (See this question for several options for VS 2005 and VS 2008).

Is it possible to do VS 2010? What we have found is that macros do not work in VS 2010 (at least I could not work them) as it appears that there is no fire in environmental events in VS 2010.

The default behavior is to continue as quickly as possible and display a list of errors in the error window.

The answer to VS 2010 is only please, please do not give me an error (file-level) as soon as possible or as soon as one project (project-level) fails to close it. I am happy for If macros works then how to configure them for VS 2010, it will be explained in detail.

Thank you.

(You can now, if you do not want to make it yourself)

< P> This answer only works in VS-2010 (seems right :)). I have kept it before you can make it, you will need it. Once you do this, then grab the full source from Gitob (also include project files) and you build your normal VS. In examples, you can install the output by finding and opening VSiX in your build output.

Important part is:

  Public Zero Text Visuals (IWpfTextView textView) {var dte = GlobalServiceProvider.GetService (Typef (DTE)) as DTE; TextView.TextBuffer.Changed + = (Sender, Args) => {// Output window is flexible and writes full lines at a time, so we only need to see the converted text. Foreign currency (var changes in args.Changes) {string text = args.After.GetText (change.NewSpan); If (BuildError.IsMatch (text) dte.ExecuteCommand ("Build.Cancel"); }; }}  

... where BuildError is a regex defined above that you can tweak if the code is about to modify If you have any questions, please let me know.


Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -