Pavlo Neiman
Pavlo Neiman

Reputation: 7536

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. Is it possible to suppress it for whole assembly?

Upvotes: 0

Views: 2199

Answers (2)

Nicole Calinoiu
Nicole Calinoiu

Reputation: 20982

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.

Upvotes: 1

SLaks
SLaks

Reputation: 887225

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.

Upvotes: 1

Related Questions