Build 1162: Problem with #pragma? Follow
Guys,
I've installed 1162. Before 4.5 I think I'm right in thinking that the code snippet below suppressed the "Local variable 'canRead' is never used." which is what 168 is meant to do?
#pragma warning disable 168
bool canRead = _msmq.CanRead;
#pragma warning restore 168
Now, build 1162 shows the orange mark in the right-hand gutter of the code window. In other words, I've gone from green to orange. Is this correct? I also get a bulb giving the "suppress inspection with pragma" option and if I do RS creates this:
#pragma warning disable 168
#pragma warning disable 168
bool canRead = _msmq.CanRead;
#pragma warning restore 168
#pragma warning restore 168
In other words, it wraps the pragma with another pragma of the same kind. That sort of proves that 168 is the correct one.
It looks like 168 is therefore correct but I can't understand why it's now a problem. Have I spooked my configuration in some way? BTW, I'm using 1162 on .Net 2005.
Please sign in to leave a comment.