开发者

Code Analysis - 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.0\Team Tools\Static Analysis Tools\FxCop). 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 -->
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜