Remove C# attribute of a property dynamically

You can not remove the attribute at runtime, but you can use reflection to change the ReadOnly attribute’s ReadOnly private backing field to False. Making it the equivalent of [ReadOnly(false)]

See this article for details:

http://codinglight.blogspot.com/2008/10/changing-attribute-parameters-at.html

Edit: fixed link

Leave a Comment