ASP.NET Core on IIS: Hosting Bundle, ANCM and 500.30
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.
- Build
- 26100.33650
- Edition
- Standard / Datacenter
- Architecture
- x64
- Support
- Documentation (E1)
- Evidence
- E1Official documentation
- Verified
- 2026-10-29
- Page type
- Setup
The short answer
Section titled “The short answer”- Install the ASP.NET Core Hosting Bundle (includes the runtime + ANCM).
- Publish the app (
dotnet publish -c Release). - Point an IIS site at the publish folder.
- Set the app pool to No Managed Code.
- Fix 500.30 by reading the app’s stdout log, not by reinstalling IIS.
Install
Section titled “Install”Download the Hosting Bundle matching the app’s major version, run it, then:
dotnet --list-runtimesGet-WebGlobalModule -Name AspNetCoreModuleV2AspNetCoreModuleV2 must be present. If not, repair the Hosting Bundle and restart IIS.
Publish
Section titled “Publish”dotnet publish C:\src\app\App.csproj -c Release -o C:\sites\appPublish output includes web.config with the ANCM handler. Do not hand-write it unless you know the schema.
IIS site
Section titled “IIS site”- 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
In-process vs out-of-process
Section titled “In-process vs out-of-process”<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 / 502.5
Section titled “500.30 / 502.5”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
argumentspath; - 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.
Verify
Section titled “Verify”Invoke-WebRequest https://app.example/ -UseBasicParsing | Select-Object StatusCodeGet-Content C:\sites\app\logs\stdout_*.log -Tail 50Get-IISAppPool | Where-Object Name -eq 'apppool'Check the response, the stdout log and the pool identity. Do not debug by recycling blindly.
Lab boundary
Section titled “Lab boundary”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.