Can someone explain in plain English the difference between ConfigurationSection and ConfigurationElement?

I am reading a fantastic article on the .NET Configuration namespace (here 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 does not contain a conceptual context. MSDN also does not contain much conceptual information.

So can someone explain, please, what is a "section", what is an "element", and when would it be advisable to use each?

+4
source share
1 answer

I think itโ€™s better to read for you this series of articles that brilliantly tells you about all the details of the configurations in C #:

Unpacking Secrets .NET 2.0 Configuration

Decryption settings Mysteries.NET 2.0

Destroying Mysteries.NET 2.0 Settings

And to answer your question in simple words, a ConfigurationSection is a container containing multiple ConfigurationElement and / or ConfigurationElementCollection . The parent of the ConfigurationSection will always be the <configuration> , which is the root element in the configuration files.

ConfigurationElement is a container and / or a separate item and is always part of a ConfigurationSection .

+1
source

All Articles