Why does Asp.Net Core 2.1 WebApi return a 500.19 error?

2

I have a small webapi service, which works under Visual Studio but doesn't work under IIS. I did the next:

  1. New application was added to the default web-site in IIS console.
  2. Application was published into app folder from VS via File System (Framework-dependent and Portable options were selected).

When I try access folder with my app (like http://localhost/example/) I receive 500.19 error with code 0x8007000d. I read this error can happen if ApplicationHost.config or Web.config has wrong XML options. I use default Web.config file (ApplicationHost.config is not used by me) which VS generate, and I don't understand what can be bad in it. Here's my Web.config file:

<?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=".\Service.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" />
    </system.webServer>
  </location>
</configuration>
c#
iis
asp.net-core-webapi
asked on Stack Overflow Oct 21, 2018 by Miamy • edited Jun 12, 2019 by Ralph Willgoss

2 Answers

2

Lex Li wrote an excellent article: https://blog.lextudio.com/the-horrible-story-of-publishing-net-core-web-apps-for-beginners-6121662dd8c4, which described issues with publishing .NET Core Web Apps.

In my case, I hadn't installed the ASP.NET Core Hosting Bundle. A simple solution which is hard to be found because it is difficult to understand what should be searched for.

answered on Stack Overflow Oct 22, 2018 by Miamy • edited Jun 12, 2019 by Ralph Willgoss
0

I ran into the exact same issue and in addition to the marked correct answer, this is what worked for me:

I installed the ASP.NET Core Hosting Bundle and was still receiving the same error.

Repairing the installation resolved my issue.

Programs and Features -> Repair "Windows Server Hosting"

"If the Hosting Bundle is installed before IIS, the bundle installation must be repaired. Run the Hosting Bundle installer again after installing IIS. If the Hosting Bundle is installed after installing the 64-bit (x64) version of .NET Core, SDKs might appear to be missing (No .NET Core SDKs were detected). To resolve the problem, see Troubleshoot ASP.NET Core projects." - Install the .NET Core Hosting Bundle

answered on Stack Overflow Sep 10, 2019 by Semir Salkic • edited Sep 10, 2019 by Semir Salkic

User contributions licensed under CC BY-SA 3.0