Affected versions: Windows Server 2022

📖 ~1 min read

Table of contents
  1. Symptom & Impact
  2. Environment & Reproduction
  3. Root Cause Analysis
  4. Quick Triage
  5. Step-by-Step Diagnosis
  6. Solution — Primary Fix
  7. Solution — Alternative Approaches
  8. Verification & Acceptance Criteria
  9. Rollback Plan
  10. Prevention & Hardening
  11. Related Errors & Cross-Refs
  12. References & Further Reading

Symptom & Impact

IIS returns HTTP 500.30/500.31 and app fails to boot under ANCM in-process mode, resulting in full web service outage.

Environment & Reproduction

Often after hosting bundle mismatch, missing runtime, or environment variable/config errors introduced during deployment.

dotnet --info
Get-WinEvent -LogName Application -MaxEvents 50 | Where-Object {$_.Message -match 'ANCM|500.30|500.31'}
Get-Content C:/inetpub/wwwroot//web.config

Root Cause Analysis

The process fails before request pipeline startup due runtime incompatibility, missing dependencies, or malformed app configuration.

Quick Triage

Verify hosting bundle/runtime and attempt direct app startup from CLI to isolate IIS vs app-level failure.

cd C:/inetpub/wwwroot/
dotnet .dll
Get-Service W3SVC,WAS

Step-by-Step Diagnosis

Enable stdout logging temporarily and inspect startup exception traces in app output.

# Ensure stdoutLogEnabled=true in web.config for temporary diagnostics
Get-ChildItem C:/inetpub/wwwroot//logs -ErrorAction SilentlyContinue
Get-Content C:/inetpub/wwwroot//logs/*.log -Tail 200 -ErrorAction SilentlyContinue
Illustrative mockup for windows-server-2022 — terminal_or_powershell
ANCM startup and hosting bundle diagnostics — Illustrative mockup — Progressive Robot

Solution — Primary Fix

Install correct .NET hosting bundle/runtime, recycle app pool, and align web.config hosting model with app packaging.

Still having issues? Our IT Solutions & Services team can diagnose and resolve this for you. Get in touch for a free consultation.

%windir%/system32/inetsrv/appcmd recycle apppool /apppool.name:''
iisreset
Get-ChildItem 'C:/Program Files/dotnet/shared' -Recurse
Illustrative mockup for windows-server-2022 — event_or_log_viewer
Fixing ANCM in-process startup failures — Illustrative mockup — Progressive Robot

Solution — Alternative Approaches

Switch to out-of-process temporarily if in-process pipeline remains unstable while patching dependencies.

%windir%/system32/inetsrv/appcmd set config '' -section:system.webServer/aspNetCore /hostingModel:OutOfProcess /commit:apphost
iisreset

Verification & Acceptance Criteria

Application starts cleanly, health endpoint responds, and no new ANCM startup errors are logged.

Invoke-WebRequest -Uri 'http://localhost/health' -UseBasicParsing
Get-WinEvent -LogName Application -MaxEvents 25 | Where-Object {$_.Message -match 'ANCM' -and $_.LevelDisplayName -eq 'Error'}

Rollback Plan

Rollback deployment package or hosting model to previous known-good release if startup remains unstable.

# Restore prior app package and web.config backup
%windir%/system32/inetsrv/appcmd restore backup PreAspNetDeploy
iisreset

Prevention & Hardening

Pin runtime versions, preflight startup in CI/CD, and enforce smoke tests post-deploy before traffic cutover.

dotnet --list-runtimes
Get-FileHash C:/inetpub/wwwroot//web.config

Related to 500.32 load failures, missing runtime packs, and appsettings/environment variable startup exceptions.

View all Windows Server 2022 tutorials on the Tutorials Hub →

Browse all common problems & solutions on the Tutorials Hub.

References & Further Reading

Microsoft ASP.NET Core on IIS hosting docs, ANCM troubleshooting guidance, and deployment hardening checklists.

Need Expert Help?

If you cannot resolve this yourself, our team offers hands-on Server Management, Managed IT Services, and flexible Support Plans. Contact us today — we respond within one business day.