den*_*nni 3 .net c# code-analysis fxcop visual-studio-2008
例如,标识符如iPhone.当我运行代码分析时,它给了我这个错误:
CA1709:Microsoft.Naming:通过将其更改为"I"来更正名称空间名称"iPhone.Example"中的"i"的大小写.
我尝试添加一个条目CustomDictionary.xml如下:
<Words>
<Recognized>
<Word>iphone</Word>
</Recognized>
</Words>
Run Code Online (Sandbox Code Playgroud)
然后它仍然给了我同样的错误和一个,如下:
CA1702:Microsoft.Naming:名称空间名称"iPhone.Example"中的复合词"iPhone"作为离散术语存在.如果您的用法是单字,请将其称为"iphone".
然后我添加了一些规则如下:
<Compound>
<Term CompoundAlternate="IPhone">iphone</Term>
</Compound>
<DiscreteExceptions>
<Term>iphone</Term>
</DiscreteExceptions>
<Acronyms>
<CasingExceptions>
<Acronym>iPhone</Acronym>
</CasingExceptions>
</Acronyms>
Run Code Online (Sandbox Code Playgroud)
但它没有任何区别.反正有没有添加这种例外?
提前致谢.