Code Analysis checks the spelling of identifiers in your code against a built-in dictionary. If it cannot find a word in its dictionary, it fires the following warning: Identifiers should be spelled correctly.
For example, suppose your code contained a class named DoorKnokker. Code Analysis would see the identifier as a compound of two words—door and knokker. It would then fire a warning that knokker was not spelled correctly.
However, you can add words to the Code Analysis dictionary by creating a custom dictionary XML file. Place the file in the project folder if you want the new words to be project-specific. However, if you want the new words to apply to all projects, put the file in the Visual Studio root folder and then restart Visual Studio.
To create a custom dictionary
Create a file that is named CustomDictionary.xml.
Define your custom words by using the following XML structure.
<?xml version="1.0" encoding="utf-8"?>
<Dictionary>
<Words>
<Recognized>
<Word>knokker</Word>
</Recognized>
</Words>
</Dictionary>
The words defined in this structure are case insensitive. Therefore, both knokker and Knokker will be recognized.
To use the custom dictionary with all projects, put the file in the Visual Studio root install folder and restart Visual Studio. For a project-specific custom dictionary, put the file in the project folder.
Note: |
|---|
Do not add compound words, such as TextBox, to the custom dictionary.
|