Why is the dictionary debug visualizer less useful in Visual Studio 2010 for Silverlight debugging?

心已入冬 提交于 2019-11-29 09:50:34

The debugger visualizer for Dictionary is the exact same class with the exact same behavior. It is still the private Mscorlib_DictionaryDebugView class. Unexpanded it shows Count, expanded it shows an array of the elements.

Your code snippet suggests that you are using a completely different Dictionary class, one that is not generic.

There is a workaround to dump the contents of the dictionary in the debugger.

  1. To your project, add a reference to the linq dll (e.g. System.Core)

  2. Add the following statement to your source file:

    using System.Linq;

  3. In the watch window, type:

    test.Take(1)

  4. Then expand the "Results View" group row. This should give you the familiar list of key, value pairs.

[This workaround was reported by rickpastoor on connect.microsoft.com for Bug 557741]

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!