Hi, 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. Is it possible to suppress it for whole assembly?
A:
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.
SLaks
2010-10-28 13:04:46
A:
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.
Nicole Calinoiu
2010-10-28 13:08:02