Register custom IDumpExtension implementation with Visual Studio

Andy Hippo 1 Reputation point
2021-03-05T10:33:43.91+00:00

Hi,

Our extension has a custom debug engine and an IDumpExtension implementation to support opening core files with it. Source for IDumpExtension impl -- https://github.com/googlestadia/vsi-lldb/blob/master/GGPDumpExtension/DumpExtension.cs#L23

What is the proper way to register this custom IDumpExtension with Visual Studio?

There's a similar old question on MSDN -- https://social.msdn.microsoft.com/Forums/en-US/9be58adc-3218-4f33-8b3f-1b9ca0adec3e
There it's mentioned that the DLL should be placed in this directory -- %VS_IDE%\Extensions\Microsoft\Debugger\Dumps, and Visual Studio will pick it up.

It does work, but it means that the DLL needs to be installed there manually and it cannot be just a part of a VSIX package. Is there another way to advertise the IDumpExtension implementation to Visual Studio? Ideally it would be just a part of VSIX, so it can be installed automatically via regular extension installation process.

Thanks!

Not Monitored
Not Monitored
Tag not monitored by Microsoft.
35,941 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Andy Hippo 1 Reputation point
    2021-04-13T15:18:03.803+00:00

    @Tianyu Sun-MSFT , Hi! Sorry for a long reply.

    After doing some experiments I've found out, that a custom implementation of IDumpExtension can be exported via [Export] attribute from any VSPackage and it will be actually picked up by Visual Studio.

    However, this seems to work only if the directory Extensions\Microsoft\Debugger\Dumps exists! If it doesn't, Visual Studio doesn't pick up my implementation of IDumpExtension exported from my VSPackage (I tried latest Visual Studio 2017 and 2019). If I just create an empty directory, then it works perfectly.

    I've looked at the implementation of DumpEngineProvider (Microsoft.VisualStudio.Debugger.EditorSystem.DumpEngineProvider from VsDebugPresentationPackage.dll). I can see that method GetExtensionModules() tries to enumerate the assemblies from Extensions\Microsoft\Debugger\ Dumps and it just bails out if the directory doesn't exist. I think if would be better to ignore the directory if it doesn't exist and fallback to resolving IDumpExtension without it.

    Would it be possible to fix it in Visual Studio?

    0 comments No comments