问题
I want to treat resharper 5.0 error "Possible NullReference Exception" as MSVS 2010 compile error. Is it possible?
回答1:
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.
来源:https://stackoverflow.com/questions/3361495/c-sharp-how-to-treat-resharper-errors-as-compile-errors-in-msvs-2010