title: How to load a separate Application Settings file dynamically and merge with current settings?
body: <p>There are questions pertaining to <a href="https://stackoverflow.com/questions/2232059/reading-settings-from-separate-config-file">reading settings from a separate config file</a> and others similar to it, but my question is specific to application property settings (i.e. <code>&lt;MyApplication.Properties.Settings&gt;</code> - see XML file below) and how to load them dynamically. I tried the method in <a href="https://stackoverflow.com/questions/531859/net-own-configuration-file">this post</a>, which involved refreshing the entire appSettings section of the main config file, but my adaptation threw exceptions because I wasn't replacing the appSettings section:</p>
  
  <pre><code>var config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.PerUserRoamingAndLocal);
  // Have tried the other ConfigurationUserLevels to no avail
  config.AppSettings.File = myRuntimeConfigFilePath;
  config.Save(ConfigurationSaveMode.Modified); // throws ConfigurationErrorsException
  ConfigurationManager.RefreshSection("userSettings");
  </code></pre>
  
  <p>The ConfigurationErrorsException.Message is "The root element must match the name of the section referencing the file, 'appSettings' (C:\myFile.xml line 2)." The file is:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;configuration&gt;
      &lt;userSettings&gt;
          &lt;MyApplication.Properties.Settings&gt;
              &lt;setting name="SineWaveFrequency" serializeAs="String"&gt;
                  &lt;value&gt;6&lt;/value&gt;
              &lt;/setting&gt;
              &lt;setting name="SineWaveAmplitude" serializeAs="String"&gt;
                  &lt;value&gt;6&lt;/value&gt;
              &lt;/setting&gt;
          &lt;/MyApplication.Properties.Settings&gt;
      &lt;/userSettings&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>Is there a way to import the values from this file into the <code>MyApplication.Properties.Settings.Default</code> class, with the framework handling all XML deserialization like it does when the config file is loaded on application startup?</p>