title: Differences in behavior between System.Web.Configuration.WebConfigurationManager and System.Configuration.ConfigurationManager
body: <p>I had some trouble on a test server with an ASP.NET website.  I goofed, and had the home
  directory of the Default Web Site pointed to the wrong place.  When I tried:</p>
  
  <pre><code>ConfigurationManager.ConnectionStrings["connectionString"]; 
  </code></pre>
  
  <p>it returned null, but</p>
  
  <pre><code>using System.Web.Configuration;
  
  /* ... */
  
  var rootWebConfig =
      WebConfigurationManager.OpenWebConfiguration(Request.ApplicationPath);
  
  WebConfigurationManager.OpenWebConfiguration(Request.ApplicationPath);
  
  rootWebConfig.ConnectionStrings.ConnectionStrings["connectionString"].ConnectionString;` 
  </code></pre>
  
  <p>returned the correct connection string.  </p>
  
  <p>What are all the differences between the two approaches?</p>
  
  <p>EDIT: What I'm really asking is, why does the <code>ConfigurationManager</code> approach fail when the home directory is incorrectly set, but succeeds otherwise, and the <code>WebConfigurationManager</code> succeeds regardless of whether the home directory is correctly set?  Are there any other differences, such as assumptions about access control?</p>