Navigation:  StyleCop 4.3 > StyleCop 4.3 Rules > Ordering Rules >

SA1203: ConstantsMustAppearBeforeFields

Previous pageReturn to chapter overviewNext page
StyleCop 4.3

Send comments on this topic.

SA1203: ConstantsMustAppearBeforeFields

Glossary Item Box

TypeName
ConstantsMustAppearBeforeFields

CheckId

SA1203

Category

Ordering Rules

 

Cause

A const field is placed beneath a non-const field.

Rule Description

A violation of this rule occurs when a const field is placed beneath a non-const field. Constants must be placed above fields to indicate that the two are fundamentally different types of elements with different considerations for the compiler, different naming requirements, etc.

How to Fix Violations

To fix an instance of this violation, place all consts above all fields.

 


© Microsoft Corporation. All Rights Reserved.