When deploying an ASP.NET Core application on IIS, you may encounter the following error:
HTTP Error 502.5 - Process Failure
This error typically occurs when the IIS worker process fails to start the ASP.NET Core application. The causes usually involve missing .NET Core runtime dependencies or a misconfigured web.config file.
In this guide, we will walk through the root causes and provide proven solutions to resolve this issue in an enterprise environment.
Common Causes of HTTP Error 502.5
Missing .NET Core Runtime – The required runtime is not installed on the IIS server.
Incorrect web.config Transformation – The processPath and arguments are not updated properly, leaving placeholder variables (%LAUNCHER_PATH%, %LAUNCHER_ARGS%) instead of the actual application paths.
Solutions to Fix IIS HTTP Error 502.5
Solution 1: Install the .NET Core Runtime
- One of the most common reasons for this error is the absence of the required .NET Core runtime on the Windows Server. Download the latest .NET Core runtime from the official Microsoft website.
- Choose the correct version depending on your application build: x64 Runtime (64-bit applications) or x86 Runtime (32-bit applications)
- Install the runtime and restart IIS.
Solution 2: Modify the web.config File
If the runtime is installed but the issue persists, the web.config file may be misconfigured.
Important: Always back up your existing web.config file before making changes.
A default untransformed configuration may look like this:
<?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 problem here is that IIS is still using placeholders %LAUNCHER_PATH% and %LAUNCHER_ARGS% instead of the actual runtime path and application DLL.
Corrected Configuration: Update the file to specify the dotnet executable and the application DLL explicitly:
<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.
Once updated, save the file and restart IIS:
# iisreset
Conclusion:
The IIS HTTP Error 502.5 - Process Failure occurs when IIS cannot correctly start your ASP.NET Core application due to either missing runtime components or incorrect web.config settings. By ensuring the correct .NET Core runtime is installed and verifying that your web.config is properly transformed with the right paths, you can quickly resolve this issue and restore application availability.
