views:

60

answers:

1

This is a simple question, but one I'm not finding much information for in the docs. When dealing with custom configuraiton sections, collections, elements, etc, when does the IsReadOnly setting actually mean read only?

With IsReadOnly returning True, I can still do things like MyBase.Item("property") = value; Are these classes only "read only" when the configuration has been read from a .config file, but always read/write when working with the classes directly?

A: 

Configuration.GetSection sets IsReadOnly before returning the ConfigurationSection. In my experience, once IsReadOnly is set, you can't change any properties on the configuration elements contained in the section. If you construct the config objects yourself, then IsReadOnly wouldn't be set unless you called SetReadOnly() from the derived class.

alexdej