title: Is it possible to create a location element in web.config programmatically (using ConfigurationLocation for example)
body: <p>I can access and modify the contents of a &lt;location&gt; tag in web.config, starting from:</p>
  
  <pre><code>Configuration config = WebConfigurationManager.OpenWebConfiguration(virtualFolderPath); 
  ConfigurationLocationCollection locations = config.Locations;
  </code></pre>
  
  <p>then for each location:</p>
  
  <pre><code>Configuration thisConfig = location.OpenConfiguration();
  </code></pre>
  
  <p>However, I cannot see any way to add a new &lt;location&gt;, is that possible?</p>