Temporarily disable code analysis for single code file with Resharper 3.0.2 and VS 2008

If you hit a code file that’s using one of the new funky features of C# 3.0, and Resharper code analysis doesn’t recognize it, like property initializers, var, etc, just press the following to disable code analysis for the current code file only:

CTRL+8

Code analysis will turn off, and the red will go away.  Resharper will remember this preference for that code file until you close and reopen Visual Studio.

If you want to turn code analysis back on, just press CTRL+8 again.  You can turn it on and off as much as you like.  I’m finding this especially useful when giving presentations such as the ones at DevTeach.  I want to keep Resharper enabled in order to use all the features, but for some of the code files, I need code analysis turned off.  CTRL+8 allows me to keep the global option on and just turn it off for a single code file.  I love little hidden gems!!