knockout-mvc icon indicating copy to clipboard operation
knockout-mvc copied to clipboard

Setting readonly property

Open drvic10k opened this issue 11 years ago • 0 comments

In method ConvertData, property.SetValue(data, value, null); tries to set value for a readonly property. This doesn't throw an exception on .NET 4.0, but on .NET 4.5 it does.

The obvious solution is checking if you can wtite to the property: if (property.CanWrite) { property.SetValue(data, value, null); }

This seems to be critical bug, I wonder if anyone else encountered this.

drvic10k avatar Jun 12 '13 21:06 drvic10k