This question already has an answer here:
When I try to retrieve the list of sections in the .config file using
Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
the config.Sections collection contains a bunch of system section but none of the sections I have file defined in the configSections tag.
Here is a blog article that should get you what you want. But to ensure that the answer stays available I'm going to drop the code in place here too. In short, make sure you're referencing the
System.Configuration
assembly and then leverage theConfigurationManager
class to get at the very specific sections you want.Make sure you read the blog article - it will give you the background so that you can fit it into your solution.