Since ASP.NET Core version 2.2, the web application is hosted in-process in w3wp.exe by default, instead of out-of-process in dotnet.exe as a child process of w3wp.exe before. This brings the new challenge for memory dump debugging, since now the debugger shows the following error when I am trying to dump out the managed call stack for a .NET Core thread:
0:035> !CLRStack OS Thread Id: 0x362c (35) Child SP IP Call Site GetFrameContext failed: 1 00000000 00000000
The issue is due to .NET Framework clr.dll is loaded into w3wp too, together with .NET Core’s coreclr.dll, which confuses the debugger.
0:035>.unload ... 0:035>.cordll -D ... 0:035>lmvm coreclr ... Image path: D:\Program Files (x86)\dotnet\shared\Microsoft.NETCore.App\2.2.2\coreclr.dll ... 0:035>.cordll -ve -u -I coreclr -lp "C:\Program Files (x86)\dotnet\shared\Microsoft.NETCore.App\2.2.2" 0:035>!clrstack ...
Using the above commands to
This solution can be applied to Function App V2 too, which hosts .NET Core in w3wp.exe too.