All rules
CA1707Naming Enabled by default: No

Identifiers should not contain underscores

Identifiers should not contain underscores

Microsoft docs

Description

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.

Cause

The name of an identifier contains the underscore (\_) character.

How to fix violations

Remove all underscore characters from the name.

Example

#pragma warning disable CA1707
// The code that's violating the rule is on this line.
#pragma warning restore CA1707

When to suppress

Do not suppress warnings for production code. However, it's safe to suppress this warning for test code.

Group results
0 yes 0 no
ConsensusNone (disabled)
Severity preference (yes voters)
Suggestion0
Warning0
Error0