CA1707: Identifiers should not contain underscores
|Fix is breaking or non-breaking||Breaking - when raised on assemblies
Non-breaking - when raised on type parameters
The name of an identifier contains the underscore (_) character.
By convention, identifier names do not contain the underscore (_) character. The rule checks namespaces, types, members, and parameters.
Naming conventions provide a common look for libraries that target the common language runtime. This reduces the learning curve that is required for new software libraries, and increases customer confidence that the library was developed by someone who has expertise in developing managed code.
How to fix violations
Remove all underscore characters from the name.
When to suppress warnings
Do not suppress warnings for production code. However, it's safe to suppress this warning for test code. You can suppress warnings from this rule by setting its severity to none.
For well-known methods in Microsoft code that currently use an underscore and cannot be modified, the rule should be suppressed.
Configure code to analyze
Use the following option to configure which parts of your codebase to run this rule on.
Include specific API surfaces
You can configure which parts of your codebase to run this rule on, based on their accessibility. For example, to specify that the rule should run only against the non-public API surface, add the following key-value pair to an .editorconfig file in your project:
dotnet_code_quality.CAXXXX.api_surface = private, internal