CA1726: Use preferred terms
The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.
For the latest documentation on Visual Studio 2017, see CA1726: Use preferred terms on docs.microsoft.com.
| TypeName | UsePreferredTerms |
| CheckId | CA1726 |
| Category | Microsoft.Naming |
| Breaking Change | Breaking - when fired on assemblies Non-breaking - when fired on type parameters |
The name of an externally visible identifier includes a term for which an alternative, preferred term exists. Alternatively, the name includes the term Flag or Flags.
This rule parses an identifier into tokens. Each single token and each contiguous dual token combination is compared to terms that are built into the rule and in the Deprecated section of any custom dictionaries. The following table shows the terms that are built into the rule and their preferred alternatives.
| Obsolete term | Preferred term |
|---|---|
| Arent | AreNot |
| Cancelled | Canceled |
| Cant | Cannot |
| ComPlus | EnterpriseServices |
| Couldnt | CouldNot |
| Didnt | DidNot |
| Doesnt | DoesNot |
| Dont | DoNot |
| Flag or Flags | There is no replacement term. Do not use. |
| Hadnt | HadNot |
| Hasn’t | HasNot |
| Havent | HaveNot |
| Indices | Indexes |
| Isnt | IsNot |
| LogIn | LogOn |
| LogOut | LogOff |
| Shouldnt | ShouldNot |
| SignOn | SignIn |
| SignOff | SignOut |
| Wasnt | WasNot |
| Werent | WereNot |
| Wont | WillNot |
| Wouldnt | WouldNot |
| Writeable | Writable |
To fix a violation of this rule, replace the term with the preferred alternative term.
Suppress a warning from this rule only if the name of the identifier is intentional and relates specifically to the original term instead of the preferred term.