CA1711: Identifiers should not have incorrect suffix

 

For the latest documentation on Visual Studio 2017, see Visual Studio 2017 Documentation.

For the latest documentation on Visual Studio 2017, see CA1711: Identifiers should not have incorrect suffix on docs.microsoft.com.

TypeNameIdentifiersShouldNotHaveIncorrectSuffix
CheckIdCA1711
CategoryMicrosoft.Naming
Breaking ChangeBreaking

An identifier has an incorrect suffix.

By convention, only the names of types that extend certain base types or that implement certain interfaces, or types derived from these types, should end with specific reserved suffixes. Other type names should not use these reserved suffixes.

The following table lists the reserved suffixes and the base types and interfaces with which they are associated.

SuffixBase type/Interface
AttributeSystem.Attribute
CollectionSystem.Collections.ICollection

 System.Collections.IEnumerable

 System.Collections.Queue

 System.Collections.Stack

 System.Collections.Generic.ICollection<T>

 System.Data.DataSet

 System.Data.DataTable
DictionarySystem.Collections.IDictionary

 System.Collections.Generic.IDictionary<TKey, TValue>
EventArgsSystem.EventArgs
EventHandlerAn event-handler delegate
ExceptionSystem.Exception
PermissionSystem.Security.IPermission
QueueSystem.Collections.Queue
StackSystem.Collections.Stack
StreamSystem.IO.Stream

In addition, the following suffixes should not be used:

  • Delegate

  • Enum

  • Impl - use 'Core' instead

  • Ex or similar suffix to distinguish it from an earlier version of the same type

Naming conventions provide a common look for libraries that target the common language runtime. This reduces the learning curve that is required for new software libraries, and increases customer confidence that the library was developed by someone who has expertise in developing managed code.

Remove the suffix from the type name.

Do not suppress a warning from this rule unless the suffix has an unambiguous meaning in the application domain.

CA1710: Identifiers should have correct suffix

Attributes
NIB: Events and Delegates

Show: