1

ClrMd 的 GitHub 上,我阅读了

// If we just happen to have the correct dac file installed on the machine,
// the "TryGetDacLocation" function will return its location on disk:
string dacLocation = version.TryGetDacLocation();

我已经通过 NuGet 添加了 ClrMd。在属性中它说版本 0.8.31.1 并且该方法在对象Microsoft.Diagnostics.Runtime上不可用。ClrVersion

class Program
{
    static void Main(string[] args)
    {
        var dump = DataTarget.LoadCrashDump(args[0]);
        dump.SymbolLocator.SymbolPath = @"srv*d:\debug\symbols\*https://msdl.microsoft.com/download/symbols";
        // TODO: Hack. We assume that there's at least one runtime.
        ClrInfo clrVersion = dump.ClrVersions[0];
    }
}

我已经看到这个问题指出该方法已被删除 - 但我该怎么做呢?

4

1 回答 1

0

ClrInfo 实例的 LocalMatchingDac 属性将为您提供 DAC 位置。

class Program
{
    static void Main(string[] args)
    {
        var dump = DataTarget.LoadCrashDump(args[0]);
        dump.SymbolLocator.SymbolPath = @"srv*d:\debug\symbols\*https://msdl.microsoft.com/download/symbols";
        // TODO: Hack. We assume that there's at least one runtime.
        ClrInfo clrVersion = dump.ClrVersions[0];
        // Get the DAC location
        string dacLocation = clrVersion.LocalMatchingDac;
    }
}

高温高压

道格

于 2017-11-02T00:26:42.633 回答