开发者

Suppress FxCop CA1822 warning for whole project

we use FxCop in current project. Warning CA1822 appears for every unit test method in test projects. So I would like to disable it for test projects. I开发者_StackOverflow社区s it possible to suppress it for whole assembly?


In VS2005 & 2008, go to the Code Analysis tab in Project Properties and uncheck that rule.

In VS2010, create a custom ruleset with that rule disabled, then select it in the Code Analysis tab in Project Properties.


If you're using stand-alone FxCop with multiple assemblies in a .fxcop project then, no, there's no way to disable specific rules for only a subset of the analysis properties. Because of CA1822, I usually create two separte .fxcop projects: one to contain all the "real" code assemblies, and a separate one for the test assemblies in which CA1822 is disabled entirely.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜