This project has moved and is read-only. For the latest updates, please go here.

Do not make Configuration Element Collections read-only

Nov 8, 2011 at 1:13 PM

If you want you configuration to be read-only (e.g. for security reasons), and you have one or more ConfigurationElementCollections and set all your definitions to be readonly, you get the Configuration is Readonly CofigurationErrorException - the cure appears to be to set the read-only element of the ConfigurationElementCollection(s) to false - I suspect that it's a problem with the framework - it instantiates an instance of the collection and then tries to add elements to it but the read-only check stops this even though it's an empty collection that's only just being built.