TypeName | SA1210UsingDirectivesMustBeOrderedAlphabeticallyByNamespace |
CheckId | SA1210 |
Category | Ordering Rules |
The using directives within a C# code file are not sorted alphabetically by namespace.
A violation of this rule occurs when the using directives are not sorted alphabetically by namespace. Sorting the using directives alphabetically makes the code cleaner and easier to read, and can help make it easier to identify the namespaces that are being used by the code. The System namespaces are an exception to this rule and will always precede all other namespaces. See SA1208 for more details.
To fix an instance of this violation, order the using directives alphabetically by namespace with all the System namespace entries first.
[SuppressMessage("StyleCop.CSharp.OrderingRules", "SA1210:UsingDirectivesMustBeOrderedAlphabeticallyByNamespace", Justification = "Reviewed.")]
#pragma warning disable SA1210 // UsingDirectivesMustBeOrderedAlphabeticallyByNamespace
#pragma warning restore SA1210 // UsingDirectivesMustBeOrderedAlphabeticallyByNamespace