This project is read-only.

CustomDictionary.xml in project without Settings.StyleCop

Oct 1, 2012 at 9:03 PM

We use a standard StyleCop setup and don't have a need to include a Settings.StyleCop file with each project.  However, we would like to have a project-specific CustomDictionary.xml file (which we're already using for FxCop/Code Analysis).  However, it doesn't look like StyleCop is picking up on that file.  Is it possible for it to use that project-level file, or do the CustomDictionary.xml files always need to be with a Settings.StyleCop file?

Oct 2, 2012 at 12:47 PM
Edited Oct 2, 2012 at 12:47 PM

From you can specify folders to search for CustomDictionary.xml files like:

    <CollectionProperty Name="DictionaryFolders">
Oct 2, 2012 at 3:18 PM

Can you have relative paths in there?  It still makes it hard to include in a project if you have to put the full path (or if it has to be in the global settings file)...

Oct 2, 2012 at 3:27 PM

Environment variables are expanded if that helps. It also looks in the same folder as the cs file its analysing already.

I'll add relative paths to the next build.

Oct 2, 2012 at 3:34 PM

I'm still getting a warning when I add a CustomDictionary.xml to the directory of the cs file. Anything I might be missing?

What I'd really prefer is for StyleCop to look in the root of the project, like FxCop does (not sure if FxCop does directory traversal, or just looks in the root).  Is that something that might be on the table as an option in the future?

Oct 2, 2012 at 3:39 PM

No, that should work fine. I'll add the root of the project too.

Oct 2, 2012 at 3:39 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.
Oct 2, 2012 at 3:42 PM

Great, thanks a bunch.

Oct 5, 2012 at 4:10 PM

Awesome, just upgraded to 4.7.41 and it's working perfectly.  Thanks again!

Oct 16, 2012 at 2:23 AM

What is a relative path relative to? The stylecop settings file?

For example, can I do this to check for a CustomDictionary.xml in the same folder as the settings file?

    <CollectionProperty Name="DictionaryFolders">