Disable C# “var” Recommendation in ReSharper

I have been trying to use type names instead of “var” in my C# code lately.  However, ReSharper wants me to convert every type name in a declaration to “var”.  The squiggles under my type names were driving me nuts, so I decided to dig into the settings to turn this off.

To disable these suggestions, do the following:

  1. Go to the ReSharper menu and select Options.
  2. From the resulting dialog box, select Code Inspection, Inspection Severity.
  3. Select the C# tab and then Language Usage Opportunities.
  4. Set both “Use var keyword when initializer explicitly declares type” and “Use “var” keyword when possible” to “Do not show”.

Rob