I've set up some custom config sections in my App.Config, such that I now have a configSection that looks like this.
<configSections>
<section name="Section1" type="ConfigSections.MySection, MyNamespace"/>
<section name="Section2" type="ConfigSections.MySection, MyNamespace"/>
<section name="Section3" type="ConfigSections.MySection, MyNamespace"/>
</configSections>
What I want to do is to read this section in code in order to find out at runtime what sections I have. I have tried:
var mySections = ConfigurationManager.GetSection("configSections");
but this returns null. I'm sure I'm missing something simple, but I cannot find anything about how to do this.
Thanks