Specify a project-specific custom dictionary for FxCop build tasks and Visual Studio Team System static code analysis

Using a project-specific custom disctionary for FxCop and FxCop build tasks is very simple. The FxCopCmd call in the FxCop-target offers the parameter /dicti...

Using a project-specific custom disctionary for FxCop and FxCop build tasks is very simple. The FxCopCmd call in the FxCop-target offers the parameter /dictionary:<DictionaryName> for that.

But for Visual Studio a little bit more steps are needed. And these steps musst me gone for all projects.

Add the custom dictionary as a link to each project. I organize such links under the special Properties-folder. So normally these links dont violate my eyes ;-)

Next step requieres editing of the csproj-files. Either you open these files with an other editor or you unload the projects and edit these files with Visual Studio.

The following lines must inserted for a custom dictionary named FxCop.CustomDictionary.xml:

<ItemGroup>

    <CodeAnalysisDictionary Include="..\FxCop.CustomDictionary.xml">

        <Link>Properties\FxCop.CustomDictionary.xml</Link>

    </CodeAnalysisDictionary>

</ItemGroup>