Skip to content

Est. 2011ยทMicrosoft Partner ID 7033487ยทDelivery under 3 minยทSupport 7 days a week

Your vault is empty.

License Error HTTP 502.5

HTTP 502.5 and 500.30: ASP.NET Core apps fail to start behind IIS

12 min read Updated October 5, 2026 Windows Server: RDS, Hyper-V & Clustering

Fix it now

These all come from the ASP.NET Core Module and they all mean the same thing in different words: the module tried to run your application and the application did not come up. IIS is healthy. The sub-status is the most specific information you will get, so read it before anything else.

Run these on the web server in an elevated Command Prompt, in order

dotnet --list-runtimes
dotnet --info
net stop was /y
net start w3svc
  1. Read the sub-status. 500.31 is a missing runtime, 500.32 an architecture mismatch, 500.33 an application that does not reference the ASP.NET Core framework, 500.34 mixed hosting models in one pool, and 500.30 or 502.5 an application that threw on startup.
  2. Open Event Viewer, Windows Logs, Application, and filter for the ASP.NET Core Module source. The exception is usually there.
  3. Install the .NET Hosting Bundle for the major version the application targets. The bundle adds the IIS module; the plain runtime installer does not.
  4. If IIS was installed after the hosting bundle, run the bundle installer again and repair it. Microsoft documents that as a required step, and it is the cause people miss.
  5. Compare dotnet --list-runtimes against what the application asks for, remembering that it only lists runtimes for the architecture of the dotnet you invoked.

Setting the application pool’s .NET CLR version to No Managed Code is documented as optional but recommended. It is worth doing, but it is not the cause of a 502.5 on its own.

If the site comes up, you are done. If not, the next section explains how the module hosts your application and which of the two ways it can fail.

Why it happens

ASP.NET Core does not run inside the managed pipeline the way an older ASP.NET application does. A native module sits in the IIS worker process and hosts the application in one of two ways. In-process hosting boots the Core CLR inside w3wp.exe itself. Out-of-process hosting starts a separate dotnet process, has it listen on a port chosen at runtime, and proxies every request to it.

That split explains the two error families. Microsoft publishes 502.5 as Process Failure: the module attempted to start the worker process and it failed to start, and the named common cause is an application targeting a version of the shared framework that is not present. The 500.3x codes are the in-process failures, raised inside the worker where the module can see what went wrong, which is why they are far more specific and why the sub-status is the first thing to read.

The application pool setting people fixate on is less important than it looks. Microsoft documents setting the .NET CLR version to No Managed Code as optional but recommended, because ASP.NET Core runs in a separate process and manages the runtime itself rather than loading the desktop CLR. It is good hygiene. It is not usually why the site is down.

The hosting bundle is missing, older than the app, or installed in the wrong order

You have this one if 500.31, or 502.5 with an event saying the framework could not be found, on a server where the application has just been deployed or upgraded.

  1. Read the target framework from the application’s runtimeconfig file in the publish output.
  2. Install the .NET Hosting Bundle for that major version. It installs the runtime, the library and the ASP.NET Core Module; the plain runtime installer does not add the module.
  3. If IIS was installed after the bundle, run the bundle installer again to repair it. This is a documented requirement and it looks exactly like a missing runtime.
  4. Restart the web stack: net stop was /y then net start w3svc.
  5. Confirm with dotnet --list-runtimes that both Microsoft.NETCore.App and Microsoft.AspNetCore.App are present at the version needed.

Installing the bundle after a 64-bit .NET installation can make SDKs appear to be missing. That is documented and separate from the site being down.

The architecture of the pool and the build disagree

You have this one if 500.32, on a self-contained application published for one processor architecture and hosted in a pool set for the other.

  1. In IIS Manager open the application pool’s Advanced Settings and read Enable 32-Bit Applications.
  2. For a 32-bit self-contained deployment using in-process hosting, set it to True. For a 64-bit one, set it to False.
  3. Remember dotnet --list-runtimes shows only the runtimes for the architecture of the dotnet you ran, so an x86 dotnet will not show your x64 runtimes and will look alarming for no reason.
  4. Recycle the pool and retry.

The application does not reference the ASP.NET Core framework

You have this one if 500.33, and the application builds and runs but was never published as an ASP.NET Core web application.

  1. Check the project’s framework reference. Only applications targeting Microsoft.AspNetCore.App can be hosted by the ASP.NET Core Module.
  2. Republish with the correct framework reference rather than changing anything on the server.
  3. Redeploy and retry. Nothing on the web server fixes this one.

This is the sub-status most often misread as a server fault. It is a build problem, and patching the server will never move it.

The application throws during startup

You have this one if 500.30, or 502.5, with a stack trace in the Application log naming a configuration value, a connection string or a missing file.

  1. Read the Application log entry from the ASP.NET Core Module source first.
  2. If it is not enough, enable the startup log: set stdoutLogEnabled to true and point stdoutLogFile at a folder that exists, then request the page once and read the file.
  3. Confirm the environment variable naming the environment is set as the application expects, at the site or application level in IIS Manager.
  4. Confirm the pool identity can read the application folder and write anywhere the application writes, including any data protection key location.
  5. Turn stdout logging off again as soon as you have your answer.

Microsoft is blunt about this: failure to disable the stdout log can lead to app or server failure, because there is no limit on file size or on the number of files created.

Full reference

Every sub-status in this family, with Microsoft’s own name for it

Status Published name Published cause
502.5 Process Failure The module tried to start the worker process and it failed to start; commonly the app targets a shared framework version that is not present
500.0 In-Process Handler Load Failure An unknown error loading ASP.NET Core Module components
500.30 In-Process Startup Failure The module tried to start the .NET CLR in-process and it failed
500.31 ANCM Failed to Find Native Dependencies The Microsoft.NETCore.App or Microsoft.AspNetCore.App runtime is not installed
500.32 ANCM Failed to Load dll The app is published for an incompatible processor architecture
500.33 ANCM Request Handler Load Failure The app did not reference the Microsoft.AspNetCore.App framework
500.34 ANCM Mixed Hosting Models Not Supported One process cannot run an in-process and an out-of-process app together
500.35 ANCM Multiple In-Process Applications in same Process One process cannot run multiple in-process apps
500.36 ANCM Out-Of-Process Handler Load Failure aspnetcorev2_outofprocess.dll is not next to aspnetcorev2.dll: a corrupted module installation
500.37 ANCM Failed to Start Within Startup Time Limit The app did not start inside the limit, which defaults to 120 seconds

The hosting bundle, and the order it has to go on in

  • The bundle installs the .NET runtime, the .NET library and the ASP.NET Core Module. The module is the part that lets the application run behind IIS, and the plain runtime installer does not include it.
  • If the bundle was installed before IIS, the bundle installation must be repaired. Run the installer again after IIS is in place.
  • If the bundle was installed after the 64-bit .NET, SDKs may appear to be missing. That is a documented side effect and not the reason your site is down.
  • Restarting IIS after the install picks up a change the installer makes to the system PATH. Restart the machine, or run net stop was /y followed by net start w3svc.

Reading dotnet output without being misled

dotnet --list-runtimes prints the installed runtimes for the architecture of the dotnet you invoked. An x86 dotnet lists only x86 runtimes and an x64 dotnet lists only x64 runtimes, so on a server carrying both, running the wrong one produces an empty-looking answer that sends people off to reinstall a runtime that was already there. dotnet --info gives the wider picture, including the operating system and the .NET installation detail.

Startup logging, used properly

Setting Where Note
stdoutLogEnabled The aspNetCore element in the site’s web.config Set to true only while diagnosing
stdoutLogFile The same element Point it at a folder that exists and that the pool identity can write to

There is no limit on stdout log file size or on the number of files created. Microsoft states that failing to disable it can lead to application or server failure. Turn it off the moment you have your answer.

What to check when the sub-status has been dealt with and it still will not start

  • Run the same publish output as the pool identity, from the same folder, before you conclude the application is at fault. The identity, the working directory and the environment variables are all different from a developer’s dotnet run.
  • Confirm the pool is running and has not been stopped by rapid-fail protection after a run of crashes.
  • Check the application’s data protection key location. An application that cannot write its keys often starts and then fails in ways that look unrelated.
  • Give each application its own pool as a default. It isolates failures, keeps recycling independent, avoids the mixed-hosting-model problem entirely, and there is no licensing cost to extra pools.

When a licence is the actual fix

Everything above is free. The hosting bundle is a no-charge download and the rest is configuration. A licence becomes part of the answer in one situation: the server is on a Windows Server release old enough that the runtime your application needs is not supported on it, which turns an application problem into a platform one. If that is where you have landed, the fix is a current host, and Windows Server 2025 Standard is the usual choice for a general-purpose web server. Arco can supply the licence and, before you buy anything, check whether an agreement you already hold covers the replacement, because a migration is often already paid for.

Every code this article covers

Code What it points at Source
HTTP 502.5 Process Failure: the module tried to start the worker process and it failed to start Microsoft Learn
HTTP 500.30 In-Process Startup Failure: the module tried to start the .NET CLR in-process and it failed Microsoft Learn
HTTP 500.31 ANCM Failed to Find Native Dependencies: the runtime the application depends on is not installed on the server Microsoft Learn
HTTP 500.32 ANCM Failed to Load dll: the application was published for an incompatible processor architecture Microsoft Learn
HTTP 500.33 ANCM Request Handler Load Failure: the application did not reference the Microsoft.AspNetCore.App framework Microsoft Learn
HTTP 500.34 ANCM Mixed Hosting Models Not Supported: one worker process cannot run an in-process and an out-of-process app together Microsoft Learn

Confirm the fix worked

  1. Request the application’s root URL and confirm it returns content rather than a 502 or a 500.
  2. Check the Application log for new entries from the ASP.NET Core Module source after that request.
  3. Run dotnet --list-runtimes from the same architecture as the pool and confirm Microsoft.AspNetCore.App is present at the version the app needs.
  4. Recycle the pool deliberately and confirm the application comes back on the first request.
  5. Confirm stdout logging is off and the log folder has stopped growing.

Questions people ask about this

Does the hosting bundle cost anything?

No. It is a free download and it is the correct thing to install on a web server. The plain runtime installer is not a substitute, because it does not add the IIS module.

Do I have to set the pool to No Managed Code?

Microsoft documents it as optional but recommended. ASP.NET Core runs in a separate process and boots its own runtime rather than loading the desktop CLR, so the setting is good hygiene rather than the fix for a 502.5.

Why does the site work with dotnet run but not under IIS?

Because the identity, the working directory and the environment variables are all different. Run the same publish output as the pool identity, from the same folder, before assuming the application is at fault.

I installed the hosting bundle and 500.31 has not gone away.

Check the install order. If the bundle went on before IIS, Microsoft requires you to run the installer again to repair it. Until you do, the module is not registered and the symptom is identical to a missing runtime.

Do I need to restart the whole server after installing the bundle?

Usually not. Restarting IIS picks up the PATH change the installer makes: stop WAS and start the World Wide Web Publishing Service, or restart the machine if you prefer.

Related error codes

Was this article helpful?

Your feedback helps us improve our documentation.

Related articles

Free Fix Event ID 1069 and 1205: a clustered role keeps failing and will not stay online Free Fix RD Web Access broken: HTTP 500.100, HTTP 404.17 and Event ID 1309 explained License Error 0x80042313 and 0x80042314: VSS freeze and thaw timeouts on busy servers Free Fix Event ID 157: disks are surprise removed and cluster storage goes offline
โ† Back to Knowledge Base