posts - 78, comments - 79, trackbacks - 84

My Links

News

View Anthony Trudeau's profile on LinkedIn

Add to Technorati Favorites

Article Categories

Archives

Post Categories

Other Links

Custom dictionary at the project level

The MSDN documentation indicates that the custom dictionary for the naming rules in the Visual Studio code analysis can be applied at the project level.  I prefer a local scope for terms that don't have a scope global to all my projects (e.g. the company name is good to have global but a product name doesn't really need to be in the global dictionary).  Unfortunately, it doesn't tell you all the information you need to actually use the custom dictionary.

The first thing to do is create the custom dictionary that you want to use for the project.  The MSDN documentation provides the file format for the file.  The easiest way to do this would be to click Add New Item from the Project menu.  Select XML file and change the name to CustomDictionary.xml and then copy the format from the MSDN documentation.  Next add your words and acronyms as needed.

The final steps are all done from within Visual Studio and is where the MSDN documentation lets you down.  Select the file in the Solution Explorer and change its properties as follows:

Build Action = CodeAnalysisDictionary
Copy to Output Directory = Do not copy

These steps basically add the /dictionary switch to the build action for calling FxCopCmd.  I've added user content to the MSDN documentation online, but hopefully this article will help those that don't notice it.

Print | posted on Wednesday, December 26, 2007 7:58 PM | Filed Under [ .NET ]

Feedback

Gravatar

# re: Custom dictionary at the project level

I have a question, and just humor me with this one; How would you make a global custom dictionary?
3/8/2008 11:49 PM | Skoobie Du
Gravatar

# re: Custom dictionary at the project level

The documentation says the global custom dictionary needs to go into the root of the Visual Studio folder. It's not clear if that means the Visual Studio x.x folder in Program Files or the folder with the devenv.exe folder (Visual Studio x.x\Common7\IDE).
3/9/2008 4:48 AM | Anthony Trudeau
Gravatar

# re: Custom dictionary at the project level

Thanks Anthony.
3/9/2008 8:23 PM | Skoobie Du

Post Comment

Title  
Name  
Email
Url
Comment   
Please add 1 and 6 and type the answer here:

Powered by: