Local variable is never used showing as an error instead of warning

During the inspection of code refactoring I get the "Local variable 'x' is never used".  In Resharper version 5.x it would show up as a warning but in version 6.x it is showing up as an error.  But my code compiles so I know it is not a warning.  How can I change this back to the behavior in 5.x so I see the unused variables as warnings?

4 comments
Comment actions Permalink

you can modify the severity of R# messages in the options. See "Code Inspection / Inspection severity".

Regards
Klaus

0
Comment actions Permalink

I am assuming this particular inspection severity is "Unused local variable", which is set to Warning in the options.

0
Comment actions Permalink

did you select "All" in "treat warnings as errors" in the build settings of your project?

2012-06-24_05h50_02.png
This overrides R# setting

Regards
Klaus

0
Comment actions Permalink

Yes, that is the problem.  We have always had that set to "All" and in Resharper 5.x these warnings did not show up as errors.  Is this something new with 6.x?  Also Resharper must have different rules then the C# compiler about what warnings are errors because Resharper shows many messages as errors but my code still compiles.  This is a major pain because I used to rely on the red lines to indicate that my code will not compile and I can no longer do that.  Is this something you could at least provide as an option in the future?

0

Please sign in to leave a comment.