Ordering Rules


The keyword protected is positioned after the keyword internal within the declaration of a protected internal C# element.

Rule Description

A violation of this rule occurs when a protected internal element’s access modifiers are written as internal protected. In reality, an element with the keywords protected internal will have the same access level as an element with the keywords internal protected. To make the code easier to read and more consistent, StyleCop standardizes the ordering of these keywords, so that a protected internal element will always be described as such, and never as internal protected. This can help to reduce confusion about whether these access levels are indeed the same.

How to Fix Violations

To fix an instance of this violation, place the protected keyword before the internal keyword.