ReSharper
 
Get ReSharper
Get your hands on the new features ahead of the release by joining the Early Access Program for ReSharper 2025.1! Learn more

Code inspection: Replace built-in type reference with a CLR type name or a keyword

Last modified: 11 February 2024

The C# type keywords and .NET Framework (CLR) type names are interchangeable for built-in C# types. If you prefer to stick to one or another style for built-in type names, ReSharper can help you maintain your preference.

You can maintain separate styles for static member access (for example, CLR type names — var str = String.Empty;) and for locals, members, and parameters (for example, keywords — void Foo(string str){ }.

ReSharper checks all built-in type references for compliance with your preferences and if they do not comply it highlights such references and suggests the corresponding quick-fix or fix in scope. Default ReSharper's preferences say that the C# keywords are preferred.

For more information about configuring and enforcing your preferences for C# built-in type references, refer to Code Syntax Style: Built-In Type References.