Avoiding configSections in .NET app.config files

Posted by Chris Clark on Stack Overflow See other posts from Stack Overflow or by Chris Clark
Published on 2010-04-07T17:18:01Z Indexed on 2010/04/07 17:23 UTC
Read the original article Hit count: 195

Filed under:
|

I'm looking for a way to avoid declaring my configuration section in the configSections inside the App.config file. Basically, I want to specify my configuration information just like I do for built-in .NET systems. For instance, when configuring WCF, I just put stuff in the <system.serviceModel>, I don't have to declare a section in the configSections up top. The same thing applies for <system.diagnostics> and many other namespaces.

I know I could just load it up as an XML file and parse through it, but I'd prefer to stick with the pattern if possible. Moreover, looking at the WCF configuration with Reflector, I notice that it uses the same configuration subsystem (defined in System.Configuration).

If you're wondering why this is important, it's because it's confusing our IT people. If it were self contained in one place, it would be much easier on them. I also realize I'll lose the ability to have multiple of the same section type, but that's not important in our case.

© Stack Overflow or respective owner

Related posts about .NET

Related posts about configuration-files