| TypeName | SA1214ReadonlyElementsMustAppearBeforeNonReadonlyElements |
| CheckId | SA1214 |
| Category | Ordering Rules |
A readonly field is positioned beneath a non-readonly field.
A violation of this rule occurs when a readonly field is positioned beneath a non-readonly field.
This rule applies only to field declarations. The C# 8 readonly members feature (e.g. readonly struct methods, properties, indexers, or accessors) is not covered by SA1214; those members follow the normal ordering rules for their declaration kind.
To fix an instance of this violation, place all readonly fields above all non-readonly fields.
[SuppressMessage("StyleCop.CSharp.OrderingRules", "SA1214:ReadonlyElementsMustAppearBeforeNonReadonlyElements", Justification = "Reviewed.")]#pragma warning disable SA1214 // ReadonlyElementsMustAppearBeforeNonReadonlyElements
#pragma warning restore SA1214 // ReadonlyElementsMustAppearBeforeNonReadonlyElements