My ASP.NET Core app says it can't read web.config

17,899

You need to install the .NET Core hosting bundle to host .NET Core apps in IIS. The bundle installs the .NET Core Runtime, .NET Core Library, and the ASP.NET Core Module. The link to the .NET Core 2.1 hosting bundle is here: https://www.microsoft.com/net/download/thank-you/dotnet-runtime-2.1.3-windows-hosting-bundle-installer

Also make sure the following Windows features are enabled:

enter image description here

More information can be found here:

https://docs.microsoft.com/en-us/aspnet/core/host-and-deploy/iis/?view=aspnetcore-2.1&tabs=aspnetcore2x

Share:
17,899
ekolis
Author by

ekolis

Updated on August 04, 2022

Comments

  • ekolis
    ekolis almost 2 years

    I get this error when I access my app which I published to local IIS:

    HTTP Error 500.19 - Internal Server Error The requested page cannot be accessed because the related configuration data for the page is invalid.

    My web.config is really simple:

    <?xml version="1.0" encoding="utf-8"?>
    <configuration>
      <location path="." inheritInChildApplications="false">
        <system.webServer>
          <handlers>
            <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
          </handlers>
          <aspNetCore processPath="dotnet" arguments=".\TreesOnMars.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" />
        </system.webServer>
      </location>
    </configuration>
    <!--ProjectGuid: 14bfa9ba-0bd6-4ae2-a6f4-6e3e91d35263-->
    

    What could be wrong? I tried giving all users permission to read my c:\inetpub\wwwroot folder... the web.config doesn't have any obvious error in it! I tried some of the solutions at this question but they didn't work...

  • wezzix
    wezzix over 5 years
    This is the current version: microsoft.com/net/permalink/…
  • Bart De Boeck
    Bart De Boeck about 3 years
    don't forget to install iis.net/downloads/microsoft/url-rewrite
  • Grace
    Grace over 2 years
    @BartDeBoeck what is url-rewrite used for?
  • Bart De Boeck
    Bart De Boeck over 2 years