Debugger Visualizer Changes in Beta2

Some of the syntax for writing debugger visualizers has changed again with the recent Beta 2 of VS2005. They are minor, but as always, notable.

1) The VisualizerUIType is gone because all Visualizers are Modal.

[assembly: DebuggerVisualizer(typeof(DebuggerVisualizers.DataTableDebugger),VisualizerUIType.Modal, Target = typeof(System.Data.DataTable), Description = “JL DataTable”)]

[assembly: DebuggerVisualizer(typeof(DebuggerVisualizers.DataTableDebugger),Target = typeof(System.Data.DataTable), Description = “JL DataTable”)]

2) Rather than implementing the System.Diagnostics.IDebugVisualizer interface, you now will implement the Microsoft.VisualStudio.DebuggerVisualizers.DialogDebuggerVisualizer class 

public class DataTableDebugger : IDebugVisualizer

public class DataTableDebugger : DialogDebuggerVisualizer

The signature of the show method has changed as well. It now uses interfaces from the Microsoft.VisualStudio.DebuggerVisualizers namespace and no longer requires a uiType, since that is a given.

public void Show(IServiceProvider windowService, IVisualizerObjectProvider objectProvider, VisualizerUIType uiType)

public void Show(IDialogVisualizerService windowService, IVisualizerObjectProvider objectProvider)

Note that in addition to using the System.Diagnostics namespace (which gives us the DebuggerVisualizer class referenced in the assembly attribute, I am also using the Microsoft.VisualStudio.DebuggerVisualizers namespace as well.

  Sign up for my newsletter so you don't miss my conference & Pluralsight course announcements!  

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.