I am trying to create a C # debugging visualizer that can perform visualization on all objects. It seems I cannot get the assembly attribute (above the namespace) to bind this visualizer to a System.Object, like Ive, with other objects in the system. I searched in detail, but did not find examples / discussions about creating a visualizer for all objects. Here is the Im code trying to work, it works quite well when attached to String or Int32, but not to an object or object.
[assembly: System.Diagnostics.DebuggerVisualizer( typeof(Visualizers.ObjectVisualizer), typeof(Visualizers.RawObjectScource), Target = typeof(object), Description = "Object Visualizer")] namespace Visualizers { public class ObjectVisualizer : DialogDebuggerVisualizer { override protected void Show(IDialogVisualizerService windowService, IVisualizerObjectProvider objectProvider) { Console.Out.WriteLine("InShow"); MessageBox.Show(objectProvider.GetObject().ToString()); } }
As a former Java programmer who used IntelliJ Im, used to seeing in debug mode what the heap address pointed to by a particular link points to. This allows you to see immediately if two objects are referenced. In addition, there are several other things that would be valuable to understanding, but they may be a little long to explain. If I can get it to work, I have to post the final code.
So does anyone know how to make the visualizer be active for all objects?
source share