CA1704: Correct the spelling of 'Ps'
I am getting the following warning from Code Analysis in VS2010
CA1704 : Microsoft.Naming : Correct the spelling of 'Ps' in member name 'MyClass.PsCalculatedAmount' or remove it entirely if it represents any sort of Hungarian notation.
Now in my codebase 'Ps' means 'Per Share' and is used heavily, so I would like to allow it as an acceptable word/acronym.
I tried adding it to my CustomDictionary.xml under
<Words>
<Recognized>
<Word>ps</Word>
...
<Recognized>
<Words>
and also tried
<Acronyms>
<CasingExceptions>
<Acronym>Ps</Acronym>
...
<CasingExceptions>
<Acronyms>
but I still get the warning.
Is there something I should be doing differently?
I noticed that there had been a bug in FXCop regarding this which is now fixed; http://social.msdn.microsoft.com/Forums/en/vstscode/thread/54e8793c-e821-49b2-80db-ea1420acf1e6
Is there a chance that this bug still exists in the version of Visual Studio i am using: V10.0.30319?
It's being rejected because it's flagged as an unrecognized word in the "root" custom dictionary in Code Analysis installation folder (usually %ProgramFiles%Microsoft Visual Studio 10.0Team ToolsStatic Analysis ToolsFxCop). You'll need to remove it from the root dictionary unrecognized list before adding it as a recognized word in a project-specific dictionary will take effect.
"Ps" is also part of the <Unrecognized>
section in my dictionary (and I never altered it). Apart from adding it to <Recognized>
section, also remove it from the <Unrecognized>
section.
<Dictionary>
<Words>
<Unrecognized>
<!-- <Word>ps</Word> -->
...more entries
</Unrecognized>
<Recognized>
- <Word>ps</Word>
...more entries
</Recognized>
<!-- more stuff -->
链接地址: http://www.djcxy.com/p/69036.html
上一篇: VS2010代码分析期间的IDisposable和CA2000警告
下一篇: CA1704:更正'Ps'的拼写