Annotations for "Do not declare read only mutable reference types" topic.Tue, 26 Sep 2017 22:38:41 Zhttp://msdn.microsoft.com/en-us/library/ms182302(v=vs.90).aspx#CommunityContent
Patrick SheahanDisagreeing with Code Analysis RulesThe MSDN Library community content is designed primarily to enable MSDN users to provide feedback, extensions and explanations of the documentation. It is not a good way to have issues with the code analysis rules themselves addressed. To discuss the implementation of code analysis rules, post your questions or opinions on the Visual Studio Code Analysis and Code Metrics forum (http://social.msdn.microsoft.com/Forums/en-US/vstscode/). To provide feedback directly to the development team, you canFri, 12 Nov 2010 16:55:39 -0800http://msdn.microsoft.com/en-us/library/ms182302(v=vs.90).aspx#CommunityContent
DanutzpValid cases if it is intended to be a singletonI have several cases where I have valid resons to have the static object declared as readonly. It is a singleton and I do not want anyone to change the reference but it is ok to change the content.
Mon, 29 Dec 2008 19:27:31 -0800http://msdn.microsoft.com/en-us/library/ms182302(v=vs.90).aspx#CommunityContent
David A NelsonReadonly Mutable Reference typesThe article implies that there would never be any time when you would want to create a readonly field for a mutable reference type. But why should that necessarily be true? After all, we create readonly properties that return mutable collections; the purpose of the readonly property is to prevent the user from replacing the collection with a new collection instance. Why couldn't a similar situation occur for readonly fields?Thu, 31 Jan 2008 16:40:47 -0800