ASP.NET Core 2.1 and HTTP Error 502.5 - Process Failure

I was deploying my ASP.NET Core 2.1 64-bit HelloWorld application and got this error, Figure 1.

image

Figure 1, ASP.NET Core 2.1 502.5 x64 64 bit

 
Common causes of this issue: 
The application process failed to start 
The application process started but then stopped 
The application process started but failed to listen on the configured port

Troubleshooting steps: 
Check the system event log for error messages 
Enable logging the application process' stdout messages 
Attach a debugger to the application process and inspect 

What I realized was that the 64 bit .NET Core runtime is not yet on the platform.  You can check that via KUDU/SCM and look for the D:\Program Files\dotnet directory and you will not find it.  It is indeed in the D:\Program Files (x86) directory.

Here are some tips on how to make it work, but I am confident that those binaries on on the way, based on the comment in the second sentence.

I changed my deployment, see Figure 2, to a Self Contained deployment and targeted x64 and then I no longer got this issue.

image

Figure 2, ASP.NET Core 2.1 502.5 x64 64 bit

Note that if you do this you become responsible for the version of the runtime of your application.  This will deploy the runtime into your application directory.  Seriously consider not doing that unless you full understand what impacts this new responsibility has on your ability to support you application.

Comments

  • Anonymous
    January 09, 2019
    it's really helpful and it's working for me
  • Anonymous
    January 09, 2019
    if anyone need how I resolve to reply me.
  • Anonymous
    January 17, 2019
    It worked for me, thanks!!
  • Anonymous
    February 05, 2019
    The comment has been removed
  • Anonymous
    February 07, 2019
    Thank you so much. This WORKS!!!
  • Anonymous
    March 22, 2019
    Hello, thanks for your help. But what does it mean."Note that if you do this you become responsible for the version of the runtime of your application. This will deploy the runtime into your application directory. Seriously consider not doing that unless you full understand what impacts this new responsibility has on your ability to support you application."I do not understand, it means that for the user it will be less performant? or every time I'm going to publish online, do I have to make another configuration?
    • Anonymous
      May 06, 2019
      I have created Asp .NET MVC core with .NET Framework. After build, It created .exe file. I published to local system and then I uploaded to hosting folder. And when I run my application it is giving me this same issue. Can anyone help me out? I am trying to solve this issue from last 3 months but not able to find the solution. My host provider also saying, you need to check the solution by your self.
  • Anonymous
    March 25, 2019
    Thanks for the article. It really helps me to fix this error in my site.