TypeName

UsingDirectivesMustBeOrderedAlphabeticallyByNamespace

CheckId

SA1210

Category

Ordering Rules

Cause

The using directives within a C# code file are not sorted alphabetically by namespace.

Rule Description

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.

How to Fix Violations

To fix an instance of this violation, order the using directives alphabetically by namespace with all the System namespace entries first.