Fix HTTP 502.5 process failure error in ASP.NET Core

 When deploying an Asp.Net Core application to IIS, you may find IIS returning HTTP Error 502.5 process failure instead of your web page.


HTTP Error 502.5 – Process Failure

The HTTP Error 502.5 - Bad Gateway and HTTP Error 502.5 - Process Failure error messages occur in ASP.NET Core when IIS fails to execute the dotnet process.

Reasons to occur this error :

1) .NET Core Runtime is not installed
2) web.config file has not been transformed

Install the .NET Core Runtime

The most common reason for this to occur is when you haven't installed the .NET Core runtime on the server. You can download the latest .NET Core runtime from Microsoft's  .NET download page.

ASP.NET Core Web Config

In ASP.NET Core applications, the web.config file contains a handler that directs requests to the AspNetCoreModule and an Asp.Net Core element that defines and configures the ASP.NET Core process to execute your web application.

Here is the web.config file for an ASP.NET Core application:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <system.webServer>
    <handlers>
      <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
    </handlers>
    <aspNetCore processPath="%LAUNCHER_PATH%" arguments="%LAUNCHER_ARGS%" stdoutLogEnabled="true" 
        stdoutLogFile=".\logs\stdout" forwardWindowsAuthToken="false"/>
  </system.webServer>
</configuration>

Note that it's possible that you don't have a web.config file in your ASP.NET Core project. If you do not, one will be generated for you when publishing the project, as IIS and IIS Express require a web.config file when hosting an ASP.NET Core web app.

Post a Comment

If you have any questions or concerns, please let me know.

Previous Post Next Post