How to get the FxCop custom dictionary to work?

2019-01-23 00:43发布

How is it possible to get the FxCop custom dictionary to work correctly?

I have tried adding words to be recognised to the file 'CustomDictionary.xml', which is kept in the same folder as the FxCop project file. This does not seem to work, as I still get the 'Identifiers should be spelled correctly' FxCop message, even after reloading and re-running FxCop. Using version 1.36.

8条回答
走好不送
2楼-- · 2019-01-23 01:29

I struggled with most of the above answers and kept searching for a solution. I finally made this change to my .fxcop file and checked it into source control, it works both from the command line and gui fxcop

I changed this line

<CustomDictionaries SearchFxCopDir="True" SearchUserProfile="True" SearchProjectDir="True" />

to

<CustomDictionaries SearchFxCopDir="True" SearchUserProfile="True" SearchProjectDir="True" >
  <CustomDictionary Path="$(ProjectDir)/CustomDictionary.xml"/>
</CustomDictionaries>
查看更多
再贱就再见
3楼-- · 2019-01-23 01:30

Also make sure the file really is *.xml and not *.xml.txt. Then feel silly for creating a file with notepad and forgetting that it always adds a txt extension. That's what it turned out to be for me.

查看更多
登录 后发表回答