Skip to content
ptittof57 edited this page Aug 15, 2015 · 3 revisions
<title>SA1303: ConstFieldNamesMustBeginWithUpperCaseLetter</title> <script src="script/helpstudio.js" type="text/javascript"></script> <script src="script/StandardText.js" type="text/jscript"></script>
<script type="text/jscript">WritePageTop(document.title);</script>

TypeName

ConstFieldNamesMustBeginWithUpperCaseLetter

CheckId

SA1303

Category

Naming Rules

Cause

The name of a constant C# field must begin with an upper-case letter.

Rule Description

A violation of this rule occurs when the name of a field marked with the const attribute does not begin with an upper-case letter.

If the field or variable name is intended to match the name of an item associated with Win32 or COM, and thus needs to begin with a lower-case letter, place the field or variable within a special NativeMethods class. A NativeMethods class is any class which contains a name ending in NativeMethods, and is intended as a placeholder for Win32 or COM wrappers. StyleCop will ignore this violation if the item is placed within a NativeMethods class.

How to Fix Violations

To fix a violation of this rule, change the name of the constant field so that it begins with an upper-case letter, or place the item within a NativeMethods class if appropriate.

How to Suppress Violations

[SuppressMessage("StyleCop.CSharp.NamingRules", "SA1303:ConstFieldNamesMustBeginWithUpperCaseLetter", Justification = "Reviewed.")]
Clone this wiki locally