How to fix IIS HTTP Error 502.5 in ASP.NET Core?

You may encounter the below error while deploying an ASP.NET Core application in IIS. 

HTTP Error 502.5 - Process Failure

It may come if you have manually modified your web.config file of asp.net core application. There are 2 different solutions to this issue. 

  • Install the .NET Core Runtime

One of the common reasons for this issue is not installing the .net core runtime. Download the latest .net core runtime from here. You can download the required x64 or x86 bit .net core version for your application.

  • Modify your Web.config file

Make sure you are taking the backup of your web.config file before proceeding for this step. 

Web.config file of ASP.Net Core application contains a handler that directs requests to the AspNetCoreModule and aspNetCore that define and configure the ASP.NET Core process to execute your application. Below is the file for the 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>

The Cause

If your web.config file is untransformed, it may contain the variables %LAUNCHER_PATH% and %LAUNCHER_ARGS% and not the correct paths. When IIS runs ASP.NET Core, it uses %LAUNCHER_PATH% and %LAUNCHER_ARGS% and not the correct path and arguments.

The Fix 

In order to fix the HTTP Error 502.5 in ASP.NET Core, you can transform the web.config and replace the untransformed web.config file on the IIS web server.

<aspNetCore processPath="dotnet" arguments=".\MyApplication.dll" stdoutLogEnabled="true" 
    stdoutLogFile=".\logs\stdout" forwardWindowsAuthToken="false" />

%LAUNCHER_PATH% will be modified by dotnet and %LAUNCHER_ARGS% will be modified with the main web application dll .\MywebApplication.dll.

Related Articles

Is there any limitation in Table Numbers in Microsoft SQL Server database?

Depending on SQL server edition and environment, there will be limitation. Please refer to the...

Is it possible to take complete VPS backup in VPS itself?

Please note that, there is no provision to take backup of full VPS image in VPS itself. As an...

How to Install Telnet Client in Window and Linux?

Telnet Client allows you to connect to remote and local computers via Telnet protocol. Telnet...

How to install Ioncube loader for Windows?

Following are the steps to add the Ioncube for PHP 7. Login to VPS. Download the Windows VC14...

How to redirect website from HTTP to https in IIS?

If we install the SSL Certificate on a website, it is required to redirect the website from HTTP...

  • 0 Users Found This Useful

Was this answer helpful?