Make Code Analysis stop warning about a certain variable name
I have a variable named like allowedZHs
. ZH
is a domain specific acronym. ZHs
is its plural form. I would like to continue using that plural form. I find it much more expressive than the "correct" form " Zhs
".
I tried to tell Code Analysis this by adding a Code Analysis Dictionary. This works fine for the singular form " ZH
" but it doesn't work for the plural form.
I still get warning CA1704.
I tried adding it as a recognized word and adding it as an acronym:
<Dictionary>
<Words>
<Recognized>
<Word>ZHs</Word>
</Recognized>
</Words>
<Acronyms>
<CasingExceptions>
<Acronym>ZHs</Acronym>
</CasingExceptions>
</Acronyms>
</Dictionary>
Any ideas what I am doing wrong?
The bad news is that there's no way to use the dictionary to allow plural acronyms in older FxCop versions. (See, for example, Kevin Blasko's answer at http://social.msdn.microsoft.com/Forums/eu/vstscode/thread/56af1337-895d-47ec-ac72-71cf0316ea60.) The good news is that the version that ships with VS 2012 allows them out-of-the-box, so you won't even need to touch the dictionary when you eventually upgrade.
链接地址: http://www.djcxy.com/p/11840.html下一篇: 使代码分析停止关于某个变量名称的警告