Klaus Groenbaek
Klaus Groenbaek

Reputation: 5035

Asp.Net Core tag in web.config causes failure

I have a .NET Core application which works on one machine but not on another.

The problem is that the application fails to load, because the IIS does not recognize the following

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

The result is that when I click on the IIS authentication configuration, I get an error. If I remove the aspNetCore tag I can view the authentication settings, but then the application doesn't actually start.

Before you start giving advice about not using web.config for .NET Core, remember that it works on my other machine. Also, I need to use Windows Security and ASP.NET Impersonation.

Both machines are running Windows 10 Pro, and I have checked the following

I don't normally work with IIS and .NET, so I'm quite puzzled that my application breaks on one of two seemingly identical installations. I have run out of things to check. Any help or pointers would be greatly appreciated.

Here is the complete web.config

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <system.web>
    <authentication mode="Windows" />
    <authorization>
      <deny users="?" />
    </authorization>
    <identity impersonate="true" />
  </system.web>
  <system.webServer>
    <handlers>
      <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
    </handlers>
    <aspNetCore processPath="dotnet" arguments=".\MyApp.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" />
  </system.webServer>
</configuration>
<!--ProjectGuid: a447f5e7-6aee-4d26-bef4-c7111a88c409-->

Upvotes: 23

Views: 19943

Answers (1)

Kiran B
Kiran B

Reputation: 715

I was also facing the same issue and it was because the machine was missing the NET Core Windows Server Hosting bundle. If this is not installed then IIS cannot recognize the aspNetCore section in web.config

You can install the bundle from below location.

NET Core Windows Server Hosting bundle

Upvotes: 24

Related Questions