Dictionaries look ugly in CLR Debugger (DbgCLR)
Dictionary values look ugly in CLR Debugger. Is there a way to make them appear in more friendly way? I wa开发者_Python百科nt to see just keys and values instead of all these recursively nested properties.
UPD: The best trade-off found so far:
new ArrayList(myDictionary).ToArray()
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.
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)!
精彩评论