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.