title: How to retrieve a value from the userSettings section in c#
body: <p>I have this config file</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;configuration&gt;
    &lt;configSections&gt;
      &lt;sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"&gt;
        &lt;section name="DynamicFormWorker.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" /&gt;
      &lt;/sectionGroup&gt;
    &lt;/configSections&gt;
    &lt;startup&gt;
      &lt;supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" /&gt;
    &lt;/startup&gt;
    &lt;userSettings&gt;
      &lt;DynamicFormWorker.Properties.Settings&gt;
        &lt;setting name="mandator" serializeAs="String"&gt;
          &lt;value&gt;$$mandator$$&lt;/value&gt;
        &lt;/setting&gt;
      &lt;/DynamicFormWorker.Properties.Settings&gt;
    &lt;/userSettings&gt;
    &lt;appSettings&gt;
      &lt;add key="log4net.Config" value="log4net.config" /&gt;
      &lt;add key="ClientSettingsProvider.ServiceUri" value="" /&gt;
    &lt;/appSettings&gt;
    &lt;system.web&gt;
      &lt;membership defaultProvider="ClientAuthenticationMembershipProvider"&gt;
        &lt;providers&gt;
          &lt;add name="ClientAuthenticationMembershipProvider" type="System.Web.ClientServices.Providers.ClientFormsAuthenticationMembershipProvider, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri="" /&gt;
        &lt;/providers&gt;
      &lt;/membership&gt;
      &lt;roleManager defaultProvider="ClientRoleProvider" enabled="true"&gt;
        &lt;providers&gt;
          &lt;add name="ClientRoleProvider" type="System.Web.ClientServices.Providers.ClientRoleProvider, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri="" cacheTimeout="86400" /&gt;
        &lt;/providers&gt;
      &lt;/roleManager&gt;
    &lt;/system.web&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>Now I figured out how to load a concrete config file in c# but actually I don't get my value for the mandator element. </p>
  
  <p>I am loading the exe config like this</p>
  
  <pre><code>        configLocation = new ExeConfigurationFileMap();            
          configLocation.ExeConfigFilename = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "App.config");
          exeConfig = ConfigurationManager.OpenMappedExeConfiguration(configLocation, ConfigurationUserLevel.None);
  </code></pre>
  
  <p>But how do I retrieve the mandator element inside the userSettings? Thanks</p>