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

后端 未结 2 763
醉话见心
醉话见心 2020-12-19 01:52

I was debugging in Visual Studio 2010, which we just installed and trying to look at a dictionary in the quick watch window. I see Keys and Values, but drilling into those s

相关标签:
2条回答
  • 2020-12-19 02:15

    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]

    0 讨论(0)
  • 2020-12-19 02: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.

    0 讨论(0)
提交回复
热议问题