title: Why can't I open a custom web.config file in my web ASP app?
body: <p>I can't open a web.config file in my ASP web project.</p>
  
  <p>I can add config files in my project for set the authorization pages.</p>
  
  <p>I need to open these pages to be able to update the "Roles" names from my admin page.</p>
  
  <p>After following the sample from Microsoft, it should be working normally:</p>
  
  <p><a href="http://msdn.microsoft.com/en-us/library/vstudio/4c2kcht0(v=vs.100).aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/vstudio/4c2kcht0(v=vs.100).aspx</a></p>
  
  <p><strong>Here is the C# code I use :</strong></p>
  
  <pre><code>//Open the web.config custom
  Configuration config  = WebConfigurationManager.OpenWebConfiguration("~/WebAuthorizationPilotageGeneral") as Configuration;
  
  //Get the authorization section
  
  // section is always == NULL !!!!
  
  -&gt; section = (System.Web.Configuration.AuthorizationSection)config.GetSection("authorization");
  
  //Remove all Roles before add news Roles
  section.Rules.Clear();
  autho = new System.Web.Configuration.AuthorizationRule(System.Web.Configuration.AuthorizationRuleAction.Allow);
  foreach (string role in Roles.GetAllRoles())
  {
       if (role != ttbx_RoleName.Text)
       {
            autho.Roles.Add(role);
       }
  }
  
  //Add the news Roles
  section.Rules.Add(autho);
  //Save the web.config custom
  config.Save(ConfigurationSaveMode.Full, true);
  </code></pre>
  
  <p><strong>My web.config custom file I try to load to update "authorization" section</strong></p>
  
  <pre><code>&lt;!-- WebAuthorizationPilotageGeneral.config - access pilotage page --&gt;
  &lt;authorization&gt;
    &lt;allow roles="Administrator" /&gt;
    &lt;allow roles="Audit" /&gt;
    &lt;allow roles="Copil" /&gt;
    &lt;allow roles="System" /&gt;
    &lt;allow roles="User" /&gt;
    &lt;allow roles="visitor" /&gt;
    &lt;deny users="*" /&gt;
  &lt;/authorization&gt;
  </code></pre>
  
  <p><strong>The weird things is after load the config file, my config object still have 22 sections, and should have only one => "authorization" , it's look like my (web.config) root file and not the (WebAuthorizationPilotageGeneral) config file.</strong></p>
  
  <p><img src="https://i.stack.imgur.com/Znqkz.png" alt="enter image description here"></p>
  
  <p><strong>UPDATE : I try to put my 4 config files on only one folder</strong>
  <img src="https://i.stack.imgur.com/qyfV8.png" alt="enter image description here"></p>
  
  <p><strong>Web.config file</strong>
  <img src="https://i.stack.imgur.com/l8alW.png" alt="enter image description here"></p>