0

I have a debug visualizer based on the following walkthrough:

https://learn.microsoft.com/en-us/visualstudio/debugger/walkthrough-writing-a-visualizer-in-csharp?view=vs-2017

I need to assigh my visualizer to everything - means all objects inherited from System.Object. I tried the following attribute:

[assembly: System.Diagnostics.DebuggerVisualizer(
typeof(ObjectJsonVisualizer.MyVisualizer),
typeof(ObjectJsonVisualizer.MyObjectSource),
Target = typeof(object),
Description = "Object Json Visualizer")]

But I am not seeing the option in the magnifier that Visual Studio's "Quick Watch" shows.

How can I assign a DialogDebuggerVisualizer to all objects (System.Object) ?

Allan Xu
  • 7,998
  • 11
  • 51
  • 122

1 Answers1

1

AFAIK, even VS2017 does not yet allow Visualizers on 'Object' (the Attribute is simply ignored) - but you can use a Visualizer on 'WeakReference' as workaround. You can read about the details here: https://joshsmithonwpf.wordpress.com/category/visualizers/

frank koch
  • 1,138
  • 2
  • 14
  • 27