title: Cannot deploy Razor web-site to IIS, HTTP Error 500.19 - Internal Server Error
body: <p>I am a beginner with IIS and razor pages. Currently, I am trying to deploy an internal web-site built using net core written using razor pages, but it keeps giving a server HTTP Error 500.19 - Internal Server Error.</p>
  <p>This is an internal web-site so not open to world. I looked at this thread and installed the components they mentioned by did not help.</p>
  <p><a href="https://stackoverflow.com/questions/929131/how-do-i-resolve-http-error-500-19-internal-server-error-on-iis7-0">How do I resolve &quot;HTTP Error 500.19 - Internal Server Error&quot; on IIS7.0</a></p>
  <p>As a test this is just the webapplication1 template code that is created with the wizard. So I have this on launchsettings.jon. Noted that I added the <a href="https://myinternalsite.net/" rel="nofollow noreferrer">https://myinternalsite.net/</a> which is the URL mapped. Not sure if this is necessary.</p>
  <pre><code>Properties\launchSettings.json
  
  &quot;profiles&quot;: {
      &quot;IIS Express&quot;: {
          &quot;commandName&quot;: &quot;IISExpress&quot;,
          &quot;launchBrowser&quot;: true,
          &quot;environmentVariables&quot;: {
              &quot;ASPNETCORE_ENVIRONMENT&quot;: &quot;Development&quot;
          }
      },
      &quot;WebApplication1&quot;: {
          &quot;commandName&quot;: &quot;Project&quot;,
          &quot;launchBrowser&quot;: true,
          &quot;applicationUrl&quot;: &quot;https://localhost:5001;http://localhost:5000;https://myinternalsite.net/&quot;,
          &quot;environmentVariables&quot;: {
              &quot;ASPNETCORE_ENVIRONMENT&quot;: &quot;Development&quot;
          }
      }
  }
  </code></pre>
  <p>I tired to deploy using &quot;Folder&quot;, currently the url is mapped to the server @:</p>
  <p>C:\inetpub\wwwroot\</p>
  <p>However I am publishing the site directly inside the server with &quot;Publish&quot; to folder as below:</p>
  <p><a href="https://i.stack.imgur.com/Zupns.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Zupns.png" alt="enter image description here" /></a></p>
  <p>Here are the IIS packages installed:</p>
  <p><a href="https://i.stack.imgur.com/7rCMR.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7rCMR.png" alt="enter image description here" /></a></p>
  <p>But one thing that bugs me is that when I deploy to the local folder I see this:</p>
  <p>C:\inetpub\wwwroot\wwwroot</p>
  <p>two nested wwwroot folders! Not sure if this is the problem.</p>
  <p><a href="https://i.stack.imgur.com/TybSF.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/TybSF.png" alt="enter image description here" /></a></p>
  <p>but this what I get, when trying to deploy there:</p>
  <p><a href="https://i.stack.imgur.com/DvNFj.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/DvNFj.png" alt="enter image description here" /></a></p>
  <p>but If I try to deploy to C:\inetpub, I get different errors like this:</p>
  <p><a href="https://i.stack.imgur.com/3gfac.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/3gfac.png" alt="enter image description here" /></a></p>