Configuration: when does IsReadOnly take effect?

It's a simple question, but I don't find much information in the docs. When working with custom config sections, collections, items, and so on, when IsReadOnly

does a parameter actually mean read-only?

With IsReadOnly

returning True

, I can still do things like MyBase.Item("property") = value;

.

Are these classes read-only when the configuration was read from the .config file, but always read / write when interacting directly with the classes?

+1


source to share


1 answer


Configuration.GetSection

installs IsReadOnly

before returning ConfigurationSection

. In my experience, after installation, IsReadOnly

you cannot change any of the properties of the configuration items contained in this section. If you create config objects yourself, it IsReadOnly

won't be set unless you called SetReadOnly()

from a derived class.



0


source







All Articles