ExpressionTreeVisualizer icon indicating copy to clipboard operation
ExpressionTreeVisualizer copied to clipboard

Deploy as VSIX

Open zspitz opened this issue 7 years ago • 0 comments

The recommended way to install a custom visualizer is simply to copy the DLL into the appropriate Visualizers folder. This can be either the Visual Studio install path, or within My Documents.

It's possible to use a VSIX for this purpose -- enclose the visualizer DLL in the VSIX package; and each time the application loads, check if the visualizer has been installed from the package; and if not, copy the file. This is not a really good solution, because every visualizer developer has to reimplement it for their VSIX.

I think a better solution would be to create an extension to manage visualizers. On load, it would go over each VSIX package and find visualizers (indicate the visualizer in the package somehow? in the package metadata? Checking all the DLLs for a reference to Microsoft.Debugger.Visualizer.DLL doesn't make sense). Then it would check the target folder (whether this particular visualizer should prefer VS-level installation if possible, or per-user installation might be part of the metadata of the package), and if the visualizer isn't in the target folder, or an older version is in the target folder, it would copy over the visualizer.

A natural part of this extension could be a way to manage visualizers:

  • grid view - location, per VS instance / per user, filename, visualizer title, visualized type, (delete), (browse location)
  • tree view - grouped by location, physical file
  • buttons - install visualizer from file, install from VSIX

The information could be extracted from the DLLs, or from .natvis files.

Then, individual visualizer authors could include the visualizer in a VSIX with appropriate metadata, list the above extension as a dependency, and everything else would happen automatically.

zspitz avatar Feb 20 '19 01:02 zspitz