title: How to save value for key in *config file
body: <p>Try to store and to read some user definde value to *.config file
  Code for reading from file</p>
  
  <pre><code>public int GetVolumeFromConfigFile()
      {
          return  Convert.ToInt32(ConfigurationManager.AppSettings["Volume"]);         
      }
  </code></pre>
  
  <p>Works perfect</p>
  
  <p>Try to update existing key with this </p>
  
  <pre><code>   public int SetVolumeFromConfigFile()
      {
         ConfigurationManager.AppSettings["Volume"] = "10";         
      }
  </code></pre>
  
  <p>Got error - file only for reading, change for something like this:</p>
  
  <pre><code>Configuration config = ConfigurationManager.OpenExeConfiguration(Application.ExecutablePath);
          config.AppSettings.Settings.Add(label.Text.ToString(), box.Value.ToString());
          config.Save(ConfigurationSaveMode.Minimal);
  </code></pre>
  
  <p>Got no errors, but nothing changed in file.</p>
  
  <p>My *.config file is :</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="PlayDemo.SettingsPlayIt" 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;PlayDemo.SettingsPlayIt&gt;
          &lt;setting name="Volume" serializeAs="String"&gt;
  
          &lt;/setting&gt;
      &lt;/PlayDemo.SettingsPlayIt&gt;
  &lt;/userSettings&gt;
  </code></pre>
  
  <p>
    
    
  </p>
  
  <p>Just try to understand where I'm wrong</p>