HTTP Error 502.5 - ANCM Out-Of-Process Startup Fai

2020-02-23 05:05发布

After upgrading my project to ASP.NET Core 2.2, I tried to run the application (locally of course) and the browser displayed an error message like in the below screenshot.

enter image description here

no more errors notified by visual studio error explorer. I don't know what's happen.

21条回答
▲ chillily
2楼-- · 2020-02-23 05:38

I was also getting the same issue. And when I looked at the Output window of my solution.

enter image description here

Then I was able to see a different error, which is "The target process exited without raising CoreCLR started event", to fix this I had to remove the Microsoft.AspNetCore.All from my Nuget Packages and install Microsoft.AspNetCore.App. I also had to install the correct .Net SDK from here. Once this is done, restarted my machine and open the solution, the error was gone. Hope it helps

查看更多
趁早两清
3楼-- · 2020-02-23 05:43

you have 2 solution(this answer works on windows server I do not know anything about linux server).

first:

  • copy all folder(except bin and obj folder) of your project to server

  • open cmd in your project folder then run this command: dotnet run then all warning and error show to you(if you have error about above command not recognize download dot net core sdk from this link)

second:

  • you must changed hostingModel attribute from OutOfProcess to inprocess in web.config and you can change stdoutLogEnabled to true value for get your project error in logs folder
  • read your projects errors and fix those.

in my case web.config is:

<?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=".\BMS.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" hostingModel="OutOfProcess" />
    </system.webServer>
  </location>
</configuration>

and I change it to:

<?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=".\BMS.dll" stdoutLogEnabled="true" stdoutLogFile=".\logs\stdout" hostingModel="inprocess" />
    </system.webServer>
  </location>
</configuration>
查看更多
祖国的老花朵
4楼-- · 2020-02-23 05:44

Be carefull publishing.

When i publish it to my PreProd envitoment this conf works well: Portable

But on my Prod enviroment that conf does not work. I had to choose the especificated one: win-x64

I dont know the reason about that. If someone know i'll gratefull to know!

查看更多
登录 后发表回答