📖 ~1 min read
Table of contents
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

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

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 Errors & Cross-Refs
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.