title: IIS express applicationhost.config security is reset every time a solutions is opened in VS2012
body: <p>I have an MVC4 application been developed in VS2012 that uses forms authentication.</p>
  <pre>
  [authentication mode="Forms"]
    [forms loginUrl="~/Account/Login" timeout="2880" /]
  [/authentication]
  </pre>
  <p>It's using the default IIS 8.0 Express.</p>
  <p>Every time I open and run the app from within the VS I got the message:</p>
  <blockquote>
  <p>HTTP Error 401.2 - Unauthorized</p>
  <p>You are not authorized to view this page due to invalid authentication headers.</p>
  </blockquote>
  <p>I found out that to avoid this screen I have to change to 'true' the anonymousAuthentication and windowsAuthentication keys of the  Security section of the applicationhost.config file at the [User Documents]\IISExpress\config folder to:</p>
  <pre>
  [system.webServer]
    [security]
      [authentication]
        [anonymousAuthentication enabled="true" /]
        [windowsAuthentication enabled="true" /]
      [/authentication]
    [/security]
  [/system.webServer]
  </pre>
  <p>But every time I reopen the solution in VS the keys are reset to false.</p>
  <p>How can I make then permanently set to true?</p>
  <p>I've tried to put those key in the application's web.config but then I receive the message:</p>
  <blockquote>
  <p>HTTP Error 500.19 - Internal Server Error</p>
  <p>The requested page cannot be accessed because the related configuration data for the page is invalid.</p>
  </blockquote>
  <p>Any help folks?</p>