首页 > 解决方案 > .NET Core 运行时不匹配可用的 SDK 版本来为 WinDbg 源 SOS.DLL

问题描述

我有一个来自系统上运行的应用程序的 DMP。这是一个 .NET Core 应用程序。我正在尝试使用 WinDbg 来查看内存问题。从周围阅读看来,我需要获取与使用的运行时匹配的 SOS.DLL 文件,它似乎比预期的要困难得多。

该应用程序似乎在我的 PC 上与已发布的 SDK 不匹配的运行时上运行:

WinDbg:lmDvmcoreclr 显示

Loaded symbol image file: coreclr.dll
    Image path: C:\Program Files\WindowsApps\Microsoft.NET.CoreRuntime.2.2_2.2.27404.2_x86__8wekyb3d8bbwe\coreclr.dll
    Image name: coreclr.dll
    Browse all global symbols  functions  data
    Timestamp:        Tue Jan 22 18:40:54 2019 (5C47AA06)
    CheckSum:         004573F9
    ImageSize:        00460000
    File version:     4.6.27322.1
    Product version:  4.6.27322.1

我从https://dotnet.microsoft.com/download/dotnet-core/2.2下载 SDK以尝试找到匹配的 coreclr.dll,以便我可以使用 SOS.dll。

SDK 2.2.3 -> 构建 27414

SDK 2.2.2 -> 构建 27317

所以这个 4.6.27322.1 似乎是在我的系统上以某种方式在这些构建之间的一个版本。

有什么想法会发生这种情况以及如何获得 SOS.DLL 吗?

举一个我真正展示的问题的例子(这让我相信我应该得到确切的 SOS.DLL),当我尝试使用 SOS 时就是这样:

0:000> .loadby sos coreclr
0:000> 
0:000>  !dumpheap -stat
PDB symbol for coreclr.dll not loaded
Failed to load data access module, 0x80131c4f
Verify that 1) you have a recent build of the debugger (6.2.14 or newer)
            2) the file mscordaccore.dll that matches your version of coreclr.dll is
                in the version directory or on the symbol path
            3) or, if you are debugging a dump file, verify that the file 
                mscordaccore_<arch>_<arch>_<version>.dll is on your symbol path.
            4) you are debugging on supported cross platform architecture as 
                the dump file. For example, an ARM dump file must be debugged
                on an X86 or an ARM machine; an AMD64 dump file must be
                debugged on an AMD64 machine.

You can also run the debugger command .cordll to control the debugger's
load of mscordaccore.dll.  .cordll -ve -u -l will do a verbose reload.
If that succeeds, the SOS command should work on retry.

If you are debugging a minidump, you need to make sure that your executable
path is pointing to coreclr.dll as well.

谢谢

标签: .net-corewindbg

解决方案


推荐阅读