Dotnet Core 3.1 HTTP Error 500.19 - Internal Server Error

Viewed 11683

I was trying to create a simple (default) Web API using dotnet core 3.1 in Visual Studio 2019 using "ASP.NET Core Web Application".

Once I created the (default) application and I was able to run it on IIS Express by pressing F5 in Visual Studio.

Then I want to publish so I went to windows features and turned on IIS then configured it by installing "WebPlatformInstaller_x64_en-US.msi" and "dotnet-hosting-3.1.2-win.exe" (for dot net core).

Then I ran the following in command prompt:

net stop was /y
net start w3svc

I did the publish using "Default Web Site/Test" configuration pointing to host: http://localhost and Self Contain Package with DotNet Core 3.1.

Also created a Application pool with "No Managed Code"

Application Pool

When I went to http://localhost/Test I got the following error message:

Error Message

Here is my Web.Config:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <location path="." inheritInChildApplications="false">
    <system.webServer>
  <handlers>
    <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
  </handlers>
  <aspNetCore processPath="dotnet" arguments=".\TestApp.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" hostingModel="inprocess" />
    </system.webServer>
  </location>
</configuration>
<!--ProjectGuid: 63addee1-2c1f-4679-94f4-df9dc952d8f9-->

I'm not sure if this is relevant information, when I did Pass-through Authentication test in IIS I'm getting the following:

Pass-through Authentication Test Results

I tried so many different ways of publishing and they all at the end getting the above error message. How can we resolve this?

2 Answers
  1. ensure corresponding Application Pool configured with No Managed Code
  2. ensure you've installed .NET Core Hosting Bundle
Related