question

werat avatar image
0 Votes"
werat asked ·

Register custom IDumpExtension implementation with Visual Studio

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!


vs-extensions
· 1
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @werat , welcome to Microsoft Q&A forum. Have you checked this document: Register and unregister VSPackages?


0 Votes 0 ·

1 Answer

werat avatar image
0 Votes"
werat answered ·

@TianyuSun-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?

·
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.