All rules
CA2217Usage Enabled by default: No

Do not mark enums with FlagsAttribute

Do not mark enums with FlagsAttribute

Microsoft docs

Description

An externally visible enumeration is marked by using FlagsAttribute, and it has one or more values that are not powers of two or a combination of the other defined values on the enumeration.

Cause

An enumeration is marked with System.FlagsAttribute and it has one or more values that are not powers of two or a combination of the other defined values on the enumeration.

By default, this rule only looks at externally visible enumerations, but this is configurable.

How to fix violations

To fix a violation of this rule, remove System.FlagsAttribute from the enumeration.

When to suppress

Do not suppress a warning from this rule.

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