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 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"?>
      <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
    <aspNetCore processPath="%LAUNCHER_PATH%" arguments="%LAUNCHER_ARGS%" stdoutLogEnabled="true" 
        stdoutLogFile=".\logs\stdout" forwardWindowsAuthToken="false"/>

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

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...

What is the database connection string for my website?

It is recommended that you take the help of your web developer to define the database connection...

How Do I Check Bandwidth Utilization of VPS?

Windows VPS To check/monitor usage of each Windows VPS, we have installed bandwidth meter tool...

How to disable and remove windows defender in Windows 2016?

Windows defender is an in-build anti-virus and anti-malware protection service in Windows 2016...

Can I purchase additional RAM, Disk space and Bandwidth for VPS?

Yes, you can purchase additional RAM(Our RAM Recommendation), DiskSpace, Bandwidth and vCPU...

  • 0 Users Found This Useful

Was this answer helpful?