I'm reading through a fantastic article on the .NET Configuration namespace (found here) which talks about creating custom sections, elements, collections, widgets, and flying toasters. The only complaint I have is that the article is only technical and doesn't provide any conceptual context. MSDN doesn't appear to have much conceptual information, either.
So can someone explain, please, what a "section" is, what an "element" is, and when it would be appropriate to use each?
I think a better read for you will be this series of articles, which brilliantly tells you about all the details of configurations in C#:
Unraveling the Mysteries of .NET 2.0 Configuration
Decoding the Mysteries of .NET 2.0 Configuration
Cracking the Mysteries of .NET 2.0 Configuration
And to answer your question in simple words, ConfigurationSection
is a container which contains multiple ConfigurationElement
and/or ConfigurationElementCollection
. The parent of ConfigurationSection
will always be <configuration>
which is the root element in configuration files.
ConfigurationElement
is a container and/or single element and is always part of a ConfigurationSection
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With