Question

Dictionary values look ugly in CLR Debugger. Is there a way to make them appear in more friendly way? I want to see just keys and values instead of all these recursively nested properties.

screenshot

UPD: The best trade-off found so far:

new ArrayList(myDictionary).ToArray()

enter image description here

Was it helpful?

Solution 3

Answering my own question.

Things got much better after installation of Visual C# 2005 Express. Now, even custom visualizers work in CLR Debugger (thanks @dkson for mentioning them)!

screenshot

OTHER TIPS

the point is that when you say you only want to see keys and values, this implies at least a ToString() invocation in those objects and the Debugger is not sure this is really what you need, if you have a class Student as a key for example, should the last name or first name or average exam mark be shown? I do not know hoe the debugger would behave in case you have overridden the ToString() method in your own class, eventually, but just to make sire by default the objects are shown with their on expandable hierarchy.

You can use a DebuggerTypeProxy attribute that allows you to customize a debug view of your type.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top