Luci C
Luci C

Reputation: 199

Installed Custom Visualizer not loading in VS2022

I am trying for some hours to install a custom visualizer in VS2022. Basically it is a simple string visualizer that opens a wpf form. I followed this: https://learn.microsoft.com/en-us/visualstudio/debugger/how-to-install-a-visualizer?view=vs-2022
But the instructions do not seem to work.

When the visualizer and the test console app are in the same solution, the visualizer works, shows up. Everything is alright, but that is not of too much help

What I have tried until now, but without success:

  1. Copy all visualizer dlls in C:\Users\XXXX\Documents\Visual Studio 2022\Visualizers
  2. Copy all visualizer dlls in C:\Program Files\Microsoft Visual Studio\2022\Professional\Common7\Packages\Debugger\Visualizers
  3. Checked on multiple projects, some targeting .NET Framework 4.7.2, some .NET 6
  4. Checked on one of my colleagues pc, also with VS2022
  5. Copied all dlls to a folder here(where I found DataSetVisualizer and IEnumerableVisualizer): C:\Program Files\Microsoft Visual Studio\2022\Professional\Common7\IDE\CommonExtensions\Platform\Debugger\
  6. Run devenv /ResetSettings from an admin console
  7. Run devenv /resetskippkgs from an admin console
  8. Run Visual Studio as administrator
  9. Checked in Debug => Windows => Modules to see if the custom dll is loaded

Do you guys have any idea what should I try? Or what could be the problem? Did any of you succeeded in running a custom visualizer in VS2022

Thank you

Upvotes: 1

Views: 1982

Answers (2)

Vijay Dodamani
Vijay Dodamani

Reputation: 374

I have also face the same challenge below steps helped me to fix the issue

Navigate to Project location follow below steps -

  • Delete bin & obj folder
  • clean the solution and build the solution

Upvotes: 1

Luci C
Luci C

Reputation: 199

So, after some days, and many hours of trial and error, I could finally install and see my custom visualizer. Basically, what I have done and (I think) it solved the issues:

  1. Cleaned up all the dlls from "C:\Users\XXXX\Documents\Visual Studio 2022\Visualizers" and all of its subfolders corresponding to .net framework versions

  2. Checked that my visualizer corresponds to the correct type:

    [assembly: DebuggerVisualizer( typeof(DebuggerSide), typeof(TextChunkObjectSource), Target = typeof(IEnumerable), Description = "PDF Visualizer")]

Don't put List<TextChunk>, or IReadOnlyList<TextChunk>, instead of IEnumerable<TextChunk>

  1. Delete bin folder(s) and rebuild the visualizer project
  2. Make sure to copy the dlls in all the needed folders: I had to copy them here:
  • C:\Program Files\Microsoft Visual Studio\2022\Professional\Common7\Packages\Debugger\Visualizers\
  • C:\Program Files\Microsoft Visual Studio\2022\Professional\Common7\Packages\Debugger\Visualizers\netstandard2.0\
  • C:\Program Files\Microsoft Visual Studio\2022\Professional\Common7\Packages\Debugger\Visualizers\netcoreapp\

Upvotes: 0

Related Questions