Introduction
This short article presents you a tiny Debugger Visualizer for Visual Studio .NET 2008 to visualize Color structure data types.
A Debugger Visualizer is being used while you debug your code. Whenever you inspect a variable, Debugger Visualizers help you to display the current value of a variable in a more useful way.
There are several built-in Debugger Visualizers, e.g. for strings, for XML strings, for HTML strings or DataSets. In addition you can extend the Debugger Visualizers by providing your own. Several CodeProject members already did.
Background
Inspired by this article that shows a Debugger Visualizer for displaying Image class data types, I created this one here. No rocket science but probably quite handy, at least to me.
Installing the Debugger Visualizer
To install the Debugger Visualizer on your system, simply drop the DLL directly in the Visualizers Visual Studio .NET 2008 folder of your user account.
In my installation on Windows Vista, this complete folder path is named C:\Users\ukeim\Documents\Visual Studio 2008\Visualizers. Yours may differ.
Using the Debugger Visualizer
After this "installation", simply debug as normal, setting your breakpoints. Whenever you are about to inspect a variable of type Color
, you see the magnification glass. Click it and you see the Debugger Visualizer displaying the value.
Please note that I explicitly compiled the DLL against Visual Studio .NET 2008 (i.e. it probably will be unusable for Visual Studio .NET 2005 without rebuilding).
Building the DLL on your Own
In the download ZIP archive for this article, I included both the DLL and the source code (of course). The source contains the actual Debugger Visualizer, as well as some very tiny console applications to test it.
(Interestingly enough, you do not need to restart Visual Studio .NET in order to have changes available in the debugger. It appears immediately - nice one!)
I set up my build environment so that the output of the build (i.e. the Debugger Visualizer DLL) is being placed directly in the Visualizers folder, thus giving me maximum comfort when developing the DLL itself.
If you have this folder structure, too:
...then you can use the solution directly, since the build output points to the Visualizers folder with a relative folder path:
Enjoy using and enhancing. I'm looking forward for your feedback!
History
- 2007-12-26: Created first version