I've got a code like this:
public abstract class Base
{
// is going to be used in deriving classes
// let's assume foo is threadsafe
protected static readonly Foo StaticFoo = new Foo();
}
Visual Studio 2008's Code Analysis pops up this message:
CA2104 : Microsoft.Security : Remove the read-only designation from 'Base.StaticFoo' or change the field to one that is an immutable reference type. If the reference type 'Foo' is, in fact, immutable, exclude this message.
Is my design instrinsically flawed, or can i add a [SuppressMessage]
in the source?