Skip to content

ASP.NET Core on IIS: Hosting Bundle, ANCM and 500.30

Verified 1 min read

Install the ASP.NET Core Hosting Bundle, publish an app, set the app pool to No Managed Code, and diagnose 500.30/502.5 without guessing.

Tested onStandard / Datacenter · Build 26100.33650 · x64
E1
Build
26100.33650
Edition
Standard / Datacenter
Architecture
x64
Support
Documentation (E1)
Evidence
E1Official documentation
Verified
2026-10-29
Page type
Setup
  1. Install the ASP.NET Core Hosting Bundle (includes the runtime + ANCM).
  2. Publish the app (dotnet publish -c Release).
  3. Point an IIS site at the publish folder.
  4. Set the app pool to No Managed Code.
  5. Fix 500.30 by reading the app’s stdout log, not by reinstalling IIS.

Download the Hosting Bundle matching the app’s major version, run it, then:

Terminal window
dotnet --list-runtimes
Get-WebGlobalModule -Name AspNetCoreModuleV2

AspNetCoreModuleV2 must be present. If not, repair the Hosting Bundle and restart IIS.

Terminal window
dotnet publish C:\src\app\App.csproj -c Release -o C:\sites\app

Publish output includes web.config with the ANCM handler. Do not hand-write it unless you know the schema.

  • Physical path: C:\sites\app
  • App pool: new pool, No Managed Code
  • Binding: HTTPS with the right certificate
  • Identity: app pool identity needs read/execute on the publish folder
<aspNetCore processPath="dotnet" arguments=".\App.dll"
hostingModel="inprocess" />
  • in-process: app runs inside w3wp.exe; faster, default for modern templates.
  • out-of-process: ANCM launches dotnet App.dll; easier to see a separate process, slightly more overhead.

Pick one; do not mix hostingModel values across environments without testing.

500.30 means the app failed to start. Enable stdout logs in web.config:

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

Then read logs\stdout_*.log. Common causes:

  • missing runtime version;
  • wrong arguments path;
  • app throws at startup (config/DB/cert);
  • app pool identity cannot read the folder or write logs;
  • port/URL binding conflict.

502.5 is the same family: ANCM could not start the process.

Terminal window
Invoke-WebRequest https://app.example/ -UseBasicParsing | Select-Object StatusCode
Get-Content C:\sites\app\logs\stdout_*.log -Tail 50
Get-IISAppPool | Where-Object Name -eq 'apppool'

Check the response, the stdout log and the pool identity. Do not debug by recycling blindly.

E1. The lab did not install the Hosting Bundle or deploy an ASP.NET Core app; the steps are the production checklist for Server 2025.

Sources