再次按Enter继续执行,应用程序域Domain 2中的Sample01.exe被卸载, 目前还没查到为什么Domain 2 没被整体卸载,我猜想是因为mscorlib.dll还在还在使用。
0:006> !DumpDomain The version of SOS does not match the version of CLR you are debugging. Please load the matching version of SOS for the version of CLR you are debugging. CLR Version: 4.7.3190.0 SOS Version: 4.6.1648.0 -------------------------------------- System Domain: 7230d5a8 LowFrequencyHeap: 7230d8cc HighFrequencyHeap: 7230d918 StubHeap: 7230d964 Stage: OPEN Name: None -------------------------------------- Shared Domain: 7230d258 LowFrequencyHeap: 7230d8cc HighFrequencyHeap: 7230d918 StubHeap: 7230d964 Stage: OPEN Name: None Assembly: 00aa7a90 [C:\WINDOWS\Microsoft.Net\assembly\GAC_32\mscorlib\v4.0_4.0.0.0__b77a5c561934e089\mscorlib.dll] ClassLoader: 00aa8818 Module Name 6a681000 C:\WINDOWS\Microsoft.Net\assembly\GAC_32\mscorlib\v4.0_4.0.0.0__b77a5c561934e089\mscorlib.dll -------------------------------------- Domain 1: 00a7f410 LowFrequencyHeap: 00a7f87c HighFrequencyHeap: 00a7f8c8 StubHeap: 00a7f914 Stage: OPEN SecurityDescriptor: 00a869f0 Name: Sample02.exe Assembly: 00aa7a90 [C:\WINDOWS\Microsoft.Net\assembly\GAC_32\mscorlib\v4.0_4.0.0.0__b77a5c561934e089\mscorlib.dll] ClassLoader: 00aa8818 SecurityDescriptor: 00aa7a08 Module Name 6a681000 C:\WINDOWS\Microsoft.Net\assembly\GAC_32\mscorlib\v4.0_4.0.0.0__b77a5c561934e089\mscorlib.dll Assembly: 00aab3b8 [E:\Workspace\DotNet\WinDbgInspectCLR\Sample02\bin\Debug\Sample02.exe] ClassLoader: 00aab050 SecurityDescriptor: 00aab5f0 Module Name 0097401c E:\Workspace\DotNet\WinDbgInspectCLR\Sample02\bin\Debug\Sample02.exe -------------------------------------- Domain 2: 00ab93d8 LowFrequencyHeap: 00ab9844 HighFrequencyHeap: 00ab9890 StubHeap: 00ab98dc Stage: HANDLETABLE_NOACCESS Name: NewDomain Assembly: 00aa7a90 [C:\WINDOWS\Microsoft.Net\assembly\GAC_32\mscorlib\v4.0_4.0.0.0__b77a5c561934e089\mscorlib.dll] ClassLoader: 00aa8818 SecurityDescriptor: 00abd780 Module Name 6a681000 C:\WINDOWS\Microsoft.Net\assembly\GAC_32\mscorlib\v4.0_4.0.0.0__b77a5c561934e089\mscorlib.dll Assembly: 00acdce0 [] ClassLoader: 00acde80 SecurityDescriptor: 00abcb48 Module Name 04cf49f4 Dynamic Module 六、总结一直听说应用程序域,但对其概念、作用不甚了解,因此结合WinDbg来试图对其进行深入理解,加深印象,后续系列会继续使用WinDbg对CLR底层进行研究。
参考文献《.NET高级调试》
WinDbg 命令三部曲