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

Sites return HTTP 503 because WAS disables app pool after repeated crashes.

Environment & Reproduction

Windows Server 2022 build 20348 IIS with unstable app startup path.

Import-Module WebAdministration
Get-ItemProperty IIS:AppPoolsDefaultAppPool -Name failure
Get-WinEvent -LogName Application -MaxEvents 80 | Where-Object Id -in 5011,5057

Root Cause Analysis

Startup failures exceed rapid-fail threshold; root trigger is often config parse errors or dependency crash.

Quick Triage

Review failure counters and app startup logs.

Get-WebConfigurationProperty -pspath 'MACHINE/WEBROOT/APPHOST' -filter "system.applicationHost/applicationPools/add[@name='DefaultAppPool']/failure" -name '.'
Get-ChildItem C:inetpublogsLogFiles -Recurse | Sort LastWriteTime -Descending | Select -First 5

Step-by-Step Diagnosis

Isolate web.config issues and dependency DLL load problems.

appcmd list apppool /name:DefaultAppPool /text:*
appcmd list config /section:system.webServer
Get-WinEvent -LogName 'Microsoft-IIS-W3SVC-WP/Operational' -MaxEvents 100
Illustrative mockup for windows-server-2022 — terminal_or_powershell
WAS rapid-fail policy inspection — Illustrative mockup — Progressive Robot

Solution — Primary Fix

Fix startup fault and adjust rapid-fail only as temporary control.

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

Set-ItemProperty IIS:AppPoolsDefaultAppPool -Name failure.rapidFailProtectionMaxCrashes -Value 10
Restart-WebAppPool -Name 'DefaultAppPool'
iisreset /restart
Illustrative mockup for windows-server-2022 — event_or_log_viewer
Rapid-fail and worker process events — Illustrative mockup — Progressive Robot

Solution — Alternative Approaches

Use warmup endpoint and preload to avoid cold-start crash loops.

Set-WebConfigurationProperty -Filter '/system.applicationHost/sites/siteDefaults/application' -Name preloadEnabled -Value True
Set-WebConfigurationProperty -Filter '/system.webServer/applicationInitialization' -Name doAppInitAfterRestart -Value True

Verification & Acceptance Criteria

No 503 responses during repeated recycle tests.

for /L %i in (1,1,5) do appcmd recycle apppool /apppool.name:DefaultAppPool
Invoke-WebRequest http://localhost/ -UseBasicParsing

Rollback Plan

Revert rapid-fail threshold to baseline if masking crash root causes.

Set-ItemProperty IIS:AppPoolsDefaultAppPool -Name failure.rapidFailProtectionMaxCrashes -Value 5

Prevention & Hardening

Validate deployment artifacts before swap and enable synthetic startup tests.

appcmd add backup PreDeploy
Invoke-WebRequest http://localhost/health -UseBasicParsing

Often seen with malformed web.config transforms and missing VC++ runtimes.

Related tutorial: View the step-by-step tutorial for Windows Server 2022.

View all Windows Server 2022 tutorials on the Tutorials Hub →

Browse all common problems & solutions on the Tutorials Hub.

References & Further Reading

Microsoft Learn WAS rapid-fail protection and IIS startup troubleshooting.

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.