开发者

Custom Dictionary not working with Visual Studio 2010 Code Analysis

I can't seem to configure my CustomDictionary.xml correctly to address a couple of Code Analysis warnings I am getting in Visual Studio 2010.

The first is a namespace "Mvc" - just like the Microsoft provided namespace. I get:

CA1704: Microsoft.Naming: "Correct the spelling of 'Mvc' in namespace name 'xyz.Mvc.abc'

I've tried putting 'Mvc' in the acronyms section of the CustomDictionary like:

<Acronyms>
  <CasingExceptions>
    <Acronym>Mvc</Acronym>
  </CasingExceptions>
</Acronyms>

The warnings still appear. So, I tried putting an entry in the DiscreteExceptions node under the Words element - still nothing.

How can I properly tell CA that "Mvc" is correct?!?!

Btw, the same issue exists with an acronym representing a business unit within the company.

Secondly, I have the term "CheckOut" used in the code. It parallels a "CheckIn" method so I want it cased as I've indicated. CA says that the compound word should be cased "Checkout" and regardless where I put the entry in the CustomDictionary file, I still get the warning. How do I deal with thi开发者_运维问答s one?

Note: I do have the Build Action for the file set to CodeAnalysisDictionary and other terms are registering correctly. For some reasons, nothing I do seems to address these three.


You need to add the term to the recognized words section, not the casing exceptions section. e.g.:

<Dictionary>
    <Words>
        <Recognized>
            <Word>mvc</Word>
        </Recognized>
    </Words>
</Dictionary>
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜