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:
- Go to the ReSharper menu and select Options.
- From the resulting dialog box, select Code Inspection, Inspection Severity.
- Select the C# tab and then Language Usage Opportunities.
- Set both “Use var keyword when initializer explicitly declares type” and “Use “var” keyword when possible” to “Do not show”.