关于Windbg中SOS输出的AppDomain Stage含义的技术咨询
Great question—this is one of those undocumented CLR implementation details that only comes up when deep-diving into debugging dumps, especially with IIS-hosted .NET applications. These Stage values map directly to internal CLR state flags tracking an AppDomain's lifecycle, and while they aren't officially documented, we can piece together their meanings from CLR source code and real-world debugging experience:
Common Stage Values & Their Meanings
OPEN: This is the normal, active state of an AppDomain. When an AppDomain is in this stage, it's fully initialized (has loaded core assemblies like mscorlib), can execute code, load additional assemblies, and process requests (as seen in your Domain 289 example). This is the state you'd expect for a healthy, running AppDomain.
HANDLETABLE_NOACCESS: This is an intermediate state during AppDomain unloading. The CLR has marked the AppDomain's handle table (used to track managed objects) as read-only/unusable—no new object handles can be created, and existing handles are being cleaned up. This means the AppDomain is in the process of being destroyed but hasn't been fully removed yet (your Domain 288 is in this transition phase).
CLEARED: This is the final state after an AppDomain has been fully unloaded. All of the AppDomain's resources (heaps, loaded assemblies, class loaders) have been released and cleaned up. The AppDomain entry still exists in the CLR's metadata for tracking purposes, but it's effectively empty and no longer functional (your Domain 259 fits this description).
Additional Context
These stage values correspond to internal fields in the CLR's AppDomain class (like _domainStage in older .NET Framework versions, or similar state flags in CoreCLR). Since they're implementation details, Microsoft doesn't document them publicly—you'll only find references in open-source CoreCLR code or via reverse-engineering the CLR runtime.
For IIS-hosted apps specifically, these stages align with AppDomain recycling: an active app runs in OPEN, starts transitioning to HANDLETABLE_NOACCESS when recycling is triggered, and ends up as CLEARED once the old AppDomain is fully discarded.
内容的提问来源于stack exchange,提问作者Max Young

