HTTP Error 502.5 - ANCM Out-Of-Process Startup Failure after upgrading to ASP.NET Core 2.2

In my case, I upgraded some nuget packages to net core 2.2, but I did not have the net core 2.2 sdk installed, so I went to net core website to download the latest sdk or runtime package, and then I did a net stop was /y and then a net start w3svc in the CMD as administrator. Problem solved for me.


I ran into this issue and had a different solution. For me it was that I had a package that was out of date with the application (I had updated it on NuGet, and the library hadn't been replaced in production). Updating the package fixed it for me.

Note with this: I had to manually run dotnet.exe with the project dll in order to see the message that fixed it for me.

Hope this helps someone else down the road.


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