-
Notifications
You must be signed in to change notification settings - Fork 22
SA1306
TypeName |
FieldNamesMustBeginWithLowerCaseLetter |
CheckId |
SA1306 |
Category |
Naming Rules |
The name of a field or variable in C# does not begin with a lower-case letter.
A violation of this rule occurs when the name of a field or variable begins with an upper-case letter. Constants, non-private readonly fields and static readonly must always start with an uppercase letter, whilst private readonly fields must start with a lowercase letter. Also, public or internal fields must always start with an uppercase 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 an upper-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.
To fix a violation of this rule, change the name of the field or variable so that it begins with a lower-case letter, or place the item within a NativeMethods class if appropriate.
[SuppressMessage("StyleCop.CSharp.NamingRules", "SA1306:FieldNamesMustBeginWithLowerCaseLetter", Justification = "Reviewed.")]
- - SA0102 - Clean Install
- - Download
- - Documentation Rules - Layout Rules - Maintainability Rules - Naming Rules - Ordering Rules - Readability Rules - Spacing Rules - Suppressions
- - Adding a custom StyleCop settings page - Adding custom rule settings - Authoring a custom styleCop rule - Authoring rules metadata - Custom CSharp Language Service - Custom MSBuild Integration - Hosting StyleCop in a Custom Environment - Installing a Custom Rule - Integrating StyleCop Into Build Environments - Integrating StyleCop into MSBuild - Writing Custom Rules for StyleCop