title: How do I reload/refresh app.config?
body: <p>I want to read the <code>app.config</code> value, show it in a message box, change the value using an external text editor, and finally show the updated value.</p>
  
  <p>I tried using the following code:</p>
  
  <pre class="lang-cs prettyprint-override"><code>private void button2_Click(object sender, EventArgs e)
  {
      Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
      ConfigurationManager.RefreshSection("appSettings");
      ConfigurationManager.RefreshSection(config.AppSettings.SectionInformation.Name);
      MessageBox.Show(ConfigurationManager.AppSettings["TheValue"]);
  }
  </code></pre>
  
  <p>But it doesn't work. It shows the old value (before changing in external text editor).
  Any suggestions?</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt;
  &lt;configuration&gt;
  &lt;appSettings&gt;
    &lt;add key="TheValue" value="abc"/&gt;
  &lt;/appSettings&gt;
  &lt;/configuration&gt;
  </code></pre>