All rules
CA1823Performance Enabled by default: No
Avoid unused private fields
Avoid unused private fields
Microsoft docsDescription
Private fields were detected that do not appear to be accessed in the assembly.
Cause
This rule is reported when a private field exists in your code but is not used by any code path.
How to fix violations
To fix a violation of this rule, remove the field or add code that uses it.
Example
#pragma warning disable CA1823
// The code that's violating the rule is on this line.
#pragma warning restore CA1823When to suppress
It is safe to suppress a warning from this rule.
Your vote
Group results
0 yes 0 no
ConsensusNone (disabled)
Severity preference (yes voters)
Suggestion0
Warning0
Error0