title: IIS Express: Either a required impersonation level was not provided, or the provided impersonation level is invalid. (0x80070542)
body: <p>I am experiencing a weird issue while testing an Asp.Net Webforms application with Windows authentication &amp; IIS Express. </p>
  
  <p>Here is the context information:
  OS:</p>
  
  <pre><code>OS Name Microsoft Windows Server 2016 Standard
  Version 10.0.14393 Build 14393
  </code></pre>
  
  <p>Visual Studio 2019:</p>
  
  <pre><code>Microsoft Visual Studio Enterprise 2019
  Version 16.4.6
  VisualStudio.16.Release/16.4.6+29905.134
  Microsoft .NET Framework
  Version 4.8.03761
  </code></pre>
  
  <p>Application: Asp.net WebForms, MVC 5, Web Api 2.0 application with Windows authentication.I use Chrome &amp; FireFox to test the app and IIS Express 10.</p>
  
  <p>I have two windows accounts let's call them Account1 and Account2 under a domain called SomeDomain which is the main domain. Both accounts have Local Administrator privileges on this VM. UAC is enabled on this VM. I do not run Visual Studio as administrator. </p>
  
  <p>When I do development I am logged in as Account1 I don't have any issue with this account. However, when I log in in the application under Account2 (when I am prompted by the browser that is) I get past the default page but then I click on some other pages and I get prompted for password again. Sometimes one page might work and second time I access that page I am prompted for password! Extremely weird. I have to say I never ever had such a problem on previous development VMs, with Windows Server 2012 and Visual Studio 2017.</p>
  
  <p>Now, I started to investigate to see what's going on.
  First of all, Account2 has read access to the application directory. I double checked that using the Effective Access feature in Windows -> Security dialog.</p>
  
  <p>I checked the IIS Express log file and here is the error:</p>
  
  <pre><code>&lt;EventData&gt;
    &lt;Data Name="ContextId"&gt;{8000002A-0001-FA00-B63F-84710C7967BB}&lt;/Data&gt;
    &lt;Data Name="ModuleName"&gt;IIS Web Core&lt;/Data&gt;
    &lt;Data Name="Notification"&gt;2&lt;/Data&gt;
    &lt;Data Name="HttpStatus"&gt;500&lt;/Data&gt;
    &lt;Data Name="HttpReason"&gt;Internal Server Error&lt;/Data&gt;
    &lt;Data Name="HttpSubStatus"&gt;0&lt;/Data&gt;
    &lt;Data Name="ErrorCode"&gt;2147943746&lt;/Data&gt;
    &lt;Data Name="ConfigExceptionInfo"&gt;&lt;/Data&gt;
   &lt;/EventData&gt;
   &lt;RenderingInfo Culture="en-US"&gt;
    &lt;Opcode&gt;MODULE_SET_RESPONSE_ERROR_STATUS&lt;/Opcode&gt;
    &lt;Keywords&gt;
     &lt;Keyword&gt;RequestNotifications&lt;/Keyword&gt;
    &lt;/Keywords&gt;
    &lt;freb:Description Data="Notification"&gt;AUTHENTICATE_REQUEST&lt;/freb:Description&gt;
    &lt;freb:Description Data="ErrorCode"&gt;Either a required impersonation level was not provided, or the provided impersonation level is invalid.
   (0x80070542)&lt;/freb:Description&gt;
   &lt;/RenderingInfo&gt;
  </code></pre>
  
  <p>A search on the web shows that these errors have been plaguing developers for a very long time. But now, 2020?</p>