Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.0k views
in Technique[技术] by (71.8m points)

iis - How to fix error "ANCM In-Process Handler Load Failure"?

I'm setting up the first site in IIS on Windows Server 2016 Standard. This is a NET Core 2.2 application. I cannot get the site to show.

I am getting this error:

HTTP Error 500.0 - ANCM In-Process Handler Load Failure

What can I change to clear this error and get my site to display?

My application is a dll.

I tested my application on the server through the Command Prompt with

dotnet ./MyApp.dll

it displays in the browser but only on the server itself with (localhost:5001/).

Using this method the site cannot be accessed from any other server. When I set up the site through IIS, I get the In-Process error both on the server and from servers attempting to access the site.

At first I was receiving the Out-Process error. Something I read said to add this (hostingModel="inprocess") to my web.config so I did but now I receive the In-Process error.

The site works fine when installed on my development server.

The Event Viewer shows this error for "IIS AspNetCore Module V2":

Failed to start application '/LM/W3SVC/2/ROOT', ErrorCode '0x8000ffff'.

This is my web.config:

<?xml version="1.0" encoding="utf-8"?>
    <configuration>
  <system.web>
    <customErrors mode="RemoteOnly"></customErrors>
        <identity impersonate="false" password="****" userName="****" />
  </system.web>
  <system.webServer>
    <handlers>
      <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
    </handlers>
    <aspNetCore processPath="dotnet" arguments=".MyApp.dll" stdoutLogEnabled="false" hostingModel="inprocess" stdoutLogFile=".logsstdout" forwardWindowsAuthToken="false">
      <environmentVariables />
    </aspNetCore>
  </system.webServer>
</configuration>
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

I had the same issue in .Net core 2.2. When I replace

web.config:

<handlers>
    <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
</handlers>

to

<handlers>
    <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
</handlers>

then it works fine.

Note: The same solution also works for .Net core 2.2 and other upper versions as well.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...