Visualizer debugger not working? Did I register it incorrectly?

I created a debugger visualizer in VS2008. There are two classes that I made, in the same. DLL: -

  • BinaryDataDebuggerVisualizer
  • ImageDebuggerVisualizer

The image works fine (for example, a magnifying glass appears in debug mode), but not for byte [] one (BinaryDataDV). What my visualizer does is display binary data as an image in a modal window (if the data is a legitimate image). I compiled the code in Release mode and then dumped the .dll into C: \ Users \\ Documents \ Visual Studio 2008 \ Visualizers

this is the code i used to "define" vis ...

using

System; using System.Diagnostics; using System.Drawing; using System.IO; using System.Windows.Forms; using Microsoft.VisualStudio.DebuggerVisualizers; using Foo.DebuggerVisualizers; [assembly: DebuggerVisualizer( typeof (BinaryDataDebuggerVisualizer), typeof (VisualizerObjectSource), Target = typeof (byte[]), Description = "Binary Data to Image Visualizer")] namespace Foo.DebuggerVisualizers { public class BinaryDataDebuggerVisualizer : DialogDebuggerVisualizer { protected override void Show(IDialogVisualizerService windowService, IVisualizerObjectProvider objectProvider) { ... my code in here } } } 

I did a unit test in a debugger visualizer solution that runs and validates code that correctly displays legitimate (as well as illegal) image files. so I think the code is ok.

When I am in my real solution, this is what I am doing (where I expect the magnifying glass to show when I hover over a variable in debug mode).

 byte[] data = File.ReadAllBytes("Chick.jpg"); 

then I hover over the data variable when I paused the code during debugging on this line (using a breakpoint).

No hourglass: (

Does anyone have any idea what is wrong?

+2
debuggervisualizer visualizer
source share
1 answer

Unfortunately this is not possible. There is a limitation in the debugger visualizer environment that prevents them from functioning on array types or objects.

http://msdn.microsoft.com/en-us/library/e2zc529c.aspx

Quote from the page: "You can write your own visualizer for an object of any managed class except Object or Array"

+8
source share

All Articles