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条回答
聊天终结者
2楼-- · 2020-02-23 05:32

For me the issue was caused by dotnet publish creating a web.config entry stdoutLogFile=".\logs\stdout". The correct value should be stdoutLogFile="\\?\%home%\LogFiles\stdout".

MSDN reference: https://blogs.msdn.microsoft.com/waws/2018/06/10/troubleshooting-http-502-5-startup-issues-in-azure-appservice-for-asp-net-core-websites/

This could be a bug in the ASP.NET Core 2.2.0 runtime which may have been fixed in a later version.

查看更多
女痞
3楼-- · 2020-02-23 05:32

This error started appearing on our Dev server. I had been using this publish command which creates a "self-contained" folder of files for deployment.

dotnet publish -c release -r win7-x64 --output:bin/self_contained

My fix was to instead publish a "framework-dependent" deployment using the following command:

dotnet publish --output:bin/framework_dependent

The dev server did have a few versions of .NET Core installed (2.2.3 and 2.2.5) in this folder *C:\Program Files\dotnet\shared

I am still not clear on why the self contained publish does not work. You might think the self contained publish would be the more reliable method, but in my case it was not.

This .NET Core blog post was helpful.

查看更多
萌系小妹纸
4楼-- · 2020-02-23 05:34

My issues was malformed appsetttings.json file. I enabled standard out logging via web.config and was able to get the underlying exception throwing this error.

查看更多
走好不送
5楼-- · 2020-02-23 05:34

I got this same error while deploying .Net core app which was targeting .Net framework on Windows server. I checked event viewer on the server and turns out server didn't have .net 4.7.2 installed.

Installing it resolved issue for me.

查看更多
Melony?
6楼-- · 2020-02-23 05:37

I encountered this error after trying to publish from VS2017 to the production Windows 2016 server. (It worked fine in IIS Express on my local Win10 PC.)

I updated packages, all versions matching and updated in my code, .net core versions matching, restart IIS, rebooting... no joy.

In the Publish > Configure > Settings (left tab) I had to set the Target-runtime from "Portable" to "win-x64" (or whatever is relevant to your environment). I also opted to "Remove additional files at destination."

"Portable" is the default setting. I'm not sure what it takes for the "Portable" runtime to work properly, but might save someone else some time if a "Portable" runtime is not something you need.

enter image description here

Generally speaking, I get this error if something is mismatched in my environment. For example, one time I was upgrading one of my projects to .Net Core 3.1 from 2.2 and hadn't installed the ASP.NET Core Runtime Hosting Bundle on my server:

https://dotnet.microsoft.com/download/dotnet-core/3.1

Also, you can get this error if your Application Pool is set to True for Enable 32-Bit Applications. Try:

IIS Manager > Application Pools > app pool name > (right click) Advanced Settings > Enable 32-Bit Applications = False

查看更多
太酷不给撩
7楼-- · 2020-02-23 05:37

I ran into this issue today with my hosting - locally everything is ok but once I publish, I get this error.

I looked through the packages and found out that some .net core stuff was upgraded to 3.0 preview.

Then I changed the build option in VS2019 from "Framework-Dependent" to "Self-contained". It took 5 times longer to build and publish but now it works.

Now I'm checking with host tech support what might be an issue - officially they support 2.1 / 2.2 only, so this might be these packages from 3.0 Preview, however target build is 2.2.

查看更多
登录 后发表回答