Plunging into .NET Development

Weblog Pieter Gheysens
Microsoft .NET Development - C# - Enterprise Library - Visual Studio 2005 Team System - Compuware DevPartner - ...
 


Tuesday, July 8

FxCop custom dictionary

If you rely on Naming Guidelines of the Static Code Analysis tool that's built into Visual Studio Team System, you might get plenty spelling error messages for words that aren't valid according to the tool (CA1704 : Identifiers should be spelled correctly). The spell checker is quite aggressive! In most of the cases these are unrecognized names that might be valid for you. To prevent that those errors pop up each time without disabling the rule(s), you might want to edit the CustomDictionary.xml file (\Program Files\Microsoft Visual Studio 9.0\Team Tools\Static Analysis Tools\FxCop) to include your custom names/acronyms for recognition by the Static Code Analysis tool.

But in a team environment the option to edit the custom dictionary in the FxCop Application folder is not the good solution! So, what do you need to do in Visual Studio 2008 Team System :
  • Add a new xml file to your project
  • Go to the properties of the xml file and set the Build Action to CodeAnalysisDictionary
  • Edit the xml file to add your recognized words/acronyms


This is a new feature in VS2008 - before you had to place the CustomDictionary.xml file in the project folder and that file was picked up by the FxCop tool. Here's some more info about how to edit the .xml file or check the original .xml file in the FxCop Application folder for the schema.

Labels:

0 Comments:

Post a Comment

Links to this post:

Create a Link

<< Home