Is there a way to disable ReSharper for a specific file?

Solution 1:

This may be a feature in a more recent version than the one available when the question was originally asked.

It is possible to suppress code inspection for a specific block (or file) by using the comments:

// ReSharper disable All 

and

// ReSharper restore All

See here.

Solution 2:

You can apply this to individual files via a shortcut key.

With the file open try both of these (the actual shortcut depends upon your environment).

  • Ctrl + Shift + Alt + 8
  • Ctrl + 8

You will see that it toggles the processing of this specific file.

The name of this shortcut in the Keyboard dialog is ReSharper_EnableDaemon.

Solution 3:

In order to skip inspections in some files or folders go to ReSharper | Options | Code Inspection | Settings -> Edit Items to Skip button. Or if your code is generated add it to appropriate list in ReSharper | Options | Generate Code section. You can read more about how it works here.