Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C# how to treat Resharper errors as compile errors in msvs 2010?

I want to treat resharper 5.0 error "Possible NullReference Exception" as MSVS 2010 compile error. Is it possible?

like image 870
type_mismatch Avatar asked Jul 29 '10 10:07

type_mismatch


1 Answers

Update, since it seems people are still finding this answer:

This, or something very much like it, is possible today with e.g. StyleCop Analyzers. There's a whole bunch of analyzer tools which you can plug into the .NET compiler platform - I recommend checking out the DotNetAnalyzers GitHub org, as well as (of course) the home of the .NET compiler platform itself.


Original answer:

You can edit the type of warning that will be issued by R# under ReSharper/Options/Code Inspection/Inspection Severity.

However, this will not necessary mean that the compiler throws errors - R# isn't responsible for actually compiling the code when you hit "Build" in your project.

like image 152
Tomas Aschan Avatar answered Sep 23 '22 07:09

Tomas Aschan