VS2010 code analysis. Suppress message CA1051:DoNotDeclareVisibleInstanceFields for all class members
I have a class like this one: public class Foo { public readonly int A = 1; public readonly int B = 2; } When I run VS2010 built in Code Analysis tool, I get 2 identical warnings: that ' field '...' is visible outside of its declaring type, change its accessibility to private and add a property, with the same accessibility as the field has currently, to provide access to it '. I want to suppress this warning for all fields in my class Foo , but I don't want to mark every field with SuppressMessage attribute like this: public class Foo { [SuppressMessage("Microsoft.Design", "CA1051