title: Adding appSettings section to web.config through c# code
body: <p>I'm just reading the web.config file through this code as</p>
  
  <pre><code>Configuration configuration = WebConfigurationManager.OpenWebConfiguration("~");
  
  AppSettingsSection appSettingsSection = (AppSettingsSection)configuration.GetSection("appSettings");
  
  if (appSettingsSection != null)
  {
           appSettingsSection.Settings.Remove(key);
           config.Save();
  }
  </code></pre>
  
  <p>It works fine when <code>appSettings</code> is present in the <code>web.config</code> file.</p>
  
  <p>My query is to add <code>appSettings</code> tag in <code>web.config</code> file if it is not present.</p>