Monday, September 01, 2008
Using the Make Object ID feature we were able to turn this screenshot into that screenshot.
Building on the
The DebuggerDisplayAttribute overrides what you see for a Type in the expression windows, similar to what

The way I accomplished that for now is by creating a new class library, referencing the Parallel Extensions library and pasting one line of code:
Then I copied the output DLL to the Visualizers directory (%userprofile%\Documents\Visual Studio 2008\Visualizers). Get the DLL here for VS2008 and remember to do this for your own types so your users don't have to resort to writing their own ;-)
Building on the
Task.Current approach, I wanted to avoid having to expand the variable and instead wanted to get a quick glimpse of the properties of interest with just one glance. Then I remembered the DebuggerDisplayAttribute (part of the nice debugger visualizers wave introduced in VS2005).The DebuggerDisplayAttribute overrides what you see for a Type in the expression windows, similar to what
ToString does (except the attribute takes precedence). Hopefully the TPL team will add one to the Task class by RTM, so the previous screenshots can look something like this:
The way I accomplished that for now is by creating a new class library, referencing the Parallel Extensions library and pasting one line of code:
[assembly: System.Diagnostics.DebuggerDisplay(@"\{Id = {Id}, IsCompleted={IsCompleted}}", Target = typeof(System.Threading.Tasks.Task))]Then I copied the output DLL to the Visualizers directory (%userprofile%\Documents\Visual Studio 2008\Visualizers). Get the DLL here for VS2008 and remember to do this for your own types so your users don't have to resort to writing their own ;-)
Labels: dot NET general
Copyright © Daniel Moth



Post a Comment
Please keep comments directly relevant to this blog post. Remember that generic support questions are best posted to the MSDN Forums.
Note that Anonymous comments are likely not going to appear so Sign-in or at least pick a Name even if you don't have a URL.