title: My ASP.NET Core app says it can't read web.config
body: <p>I get this error when I access my app which I published to local IIS:</p>
  
  <blockquote>
    <p>HTTP Error 500.19 - Internal Server Error
    The requested page cannot be accessed because the related configuration data for the page is invalid.</p>
  </blockquote>
  
  <p>My web.config is really simple:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;configuration&gt;
    &lt;location path="." inheritInChildApplications="false"&gt;
      &lt;system.webServer&gt;
        &lt;handlers&gt;
          &lt;add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" /&gt;
        &lt;/handlers&gt;
        &lt;aspNetCore processPath="dotnet" arguments=".\TreesOnMars.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" /&gt;
      &lt;/system.webServer&gt;
    &lt;/location&gt;
  &lt;/configuration&gt;
  &lt;!--ProjectGuid: 14bfa9ba-0bd6-4ae2-a6f4-6e3e91d35263--&gt;
  </code></pre>
  
  <p>What could be wrong? I tried giving all users permission to read my <code>c:\inetpub\wwwroot</code> folder... the web.config doesn't have any obvious error in it! I tried some of the solutions at <a href="https://stackoverflow.com/questions/9216158/the-requested-page-cannot-be-accessed-because-the-related-configuration-data-for">this question</a> but they didn't work...</p>