TripWire
TripWire

Reputation: 552

Could not retrieve the logging settings - IIS web.config .Net Core 1.1

I am getting an internal server error currently when I try to browse to my IIS site, but no useful error messages. One thing I've noticed is that I get the above error or one like it when I access an IIS module. My web.config is pretty basic and is as follows:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <system.webServer>
    <handlers>
      <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
    </handlers>
    <aspNetCore processPath="dotnet" arguments=".\MyWebsite.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" forwardWindowsAuthToken="false" />
  </system.webServer>
</configuration>

When I comment out:

<aspNetCore processPath="dotnet" arguments=".\MyWebsite.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" forwardWindowsAuthToken="false" />

My IIS modules load but I still get the Internal Server Error.

Initially, I was thinking this might be an error with how I installed the .Net Core 1.1 Runtime, but when I run the command dotnet MyWebsite.dll from the command line, my website runs fine.

Any ideas/help appreciated, thank you!

Upvotes: 3

Views: 9851

Answers (1)

TripWire
TripWire

Reputation: 552

The issue was that I had downloaded the .Net Core Runtime Windows (x64) Installer, but should have downloaded the .Net Core Runtime Windows Server Hosting (x64 and x86) installer. The Windows Server Hosting includes the ASPNetCoreModule.

I identified the problem by looking at Handler Mappings in IIS under the site (following commenting out the line that was causing errors in IIS), and seeing that aspNetCore referenced in my web.config, had an AspNetCoreModule handler. Upon looking at Modules in IIS for that site, I noticed that AspNetCoreModule was missing.

Upvotes: 7

Related Questions