开发者

Dictionaries look ugly in CLR Debugger (DbgCLR)

开发者 https://www.devze.com 2023-02-10 14:39 出处:网络
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 proper

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.

Dictionaries look ugly in CLR Debugger (DbgCLR)

UPD: The best trade-off found so far:

new ArrayList(myDictionary).ToArray()

Dictionaries look ugly in CLR Debugger (DbgCLR)


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)!

Dictionaries look ugly in CLR Debugger (DbgCLR)

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号