如何设置 WinDbg 以调试 .NET Core 故障转储?



我启动WinDbg并将.dmp拖入其中。我跑.loadby sos coreclr然后回来:

The call to LoadLibrary(C:Program FilesdotnetsharedMicrosoft.NETCore.App2.2.5sos) failed, Win32 error 0n126
"The specified module could not be found."

我没有C:Program FilesdotnetsharedMicrosoft.NETCore.App2.2.5文件夹。 不过我确实有一个 2.2.6 文件夹。 如何告诉 WinDbg 在正确的文件夹中查找 .net 核心 clr?

安装在 cmdshell 中:

  1. dotnet tool install -g dotnet-sos
  2. dotnet-sos install
  3. 从 cmdshell 复制加载命令,例如

.load C:Usersmyuser.dotnetsossos.dll

在 WinDbg 中执行:

  1. 粘贴加载命令,例如

.load C:Usersmyuser.dotnetsossos.dll

将 WinDBG 与 .NET Core 3 结合使用

最新更新