Suddenly noticed resharper doesn't look into preprocessor directives if they are false. For example, it counts such code as good:
var debugVariable = 0;
Console.WriteLine("This use the variable in output, " + debugVariable);
Console.WriteLine("And this is not");
Now, switch to "Release" configuration and add some preprocessor directives, to get a code like this:
var debugVariable = 0;
#if DEBUG
Console.WriteLine("This use the variable in output, " + debugVariable);
#else
Console.WriteLine("And this is not");
#endif
Resharper doesn't like it and it shows that variable debugVariable is never used.
No comments:
Post a Comment