CA2104 annoyance.

Posted by acidzombie24 on Stack Overflow See other posts from Stack Overflow or by acidzombie24
Published on 2010-04-21T07:21:40Z Indexed on 2010/04/21 7:23 UTC
Read the original article Hit count: 576

Filed under:
|

With the code below i get a CA2104 (DoNotDeclareReadOnlyMutableReferenceTypes) warning

public readonly ReadOnlyCollection<char> IllegalChars;

with part of the error message

change the field to one that is an immutable reference type. If the reference type 'ReadOnlyCollection' is, in fact, immutable, exclude this message.

I am sure ReadOnlyCollection is immutable but my question is is there a type can i use to not have this message appear?

© Stack Overflow or respective owner

Related posts about c#

Related posts about visual-studio