Debugger visualizer for any ICollection and ICollection<T> types

十年热恋 提交于 2019-12-03 15:45:57
Omer Raviv

I think you've stumbled into the same limitation of the Visualizers architecture as outlined in this question.

The workaround is to create a Visualizer for System.WeakReference, and then to type in the Watch window "new WeakReference(myCollectionVariable)", and then you will be able to open your debug visualizer on the weakreference. Inside your debug visualizer you can use reflection to find out what exactly the type of your variable is, and do whatever you want with it.

See also this.

This will work fine i guess.

[assembly: DebuggerVisualizer( typeof( DebugerSide ), typeof( VisualizerObjectSource ), typeof(Collection), Description = "Collection visualizer" )]
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!