为什么字典调试可视化工具在Visual Studio 2010中用于Silverlight调试的用处不大? [英] Why is the dictionary debug visualizer less useful in Visual Studio 2010 for Silverlight debugging?

查看:112
本文介绍了为什么字典调试可视化工具在Visual Studio 2010中用于Silverlight调试的用处不大?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在Visual Studio 2010中进行调试,我们刚刚安装了Visual Studio 2010,并试图在快速监视窗口中查看字典.我看到了键和值,但深入了解这些键后会显示Count和Non-Public成员,Non-Public成员继续进行此操作,而我从没在字典中看到这些值.我可以运行test.Take(10)并查看值,但是为什么我必须这样做.我没有再安装VS 2008进行比较,但是看来我可以更轻松地调试字典.为什么现在这样呢?仅仅是我在机器上进行了某种设置吗?

测试代码:

  Dictionary<string, string> test = new Dictionary<string, string>();
    test.Add("a", "b");

我刚刚在控制台应用程序中尝试了相同的调试,它可以按预期工作.另一个项目是Silverlight 4应用程序,为什么它们不同?

.

来自Microsoft Connect的回复: 这是我们的遗漏-我们之前已为Visual Studio 2008 SP1修复了此确切问题,但遗憾的是,此修复程序未移植到Visual Studio 2010代码库中.现在,此问题已再次得到修复(这次是永久的!),我们正在考虑在VS2010 SP1中发布此修复程序.

亚历克斯·特纳 项目经理 Visual Basic和C#编译器",因此应尽快修复.

我刚刚在SP1中仔细检查了一下,它可以正常工作.

解决方案

Dictionary的调试器可视化器是具有完全相同行为的完全相同的类.它仍然是私有的Mscorlib_DictionaryDebugView类.展开后将显示Count,展开后将显示元素数组.

您的代码段建议您使用的是完全不同的Dictionary类,这不是通用类.

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 shows the Count and Non-Public members, Non-Public members continues the trail and I never see the values in the dictionary. I can run test.Take(10) and see the values, but why should I have to do that. I don't have VS 2008 installed anymore to compare, but it seems that I could debug a dictionary much easier. Why is it this way now? Is it just a setting I set somehow on my machine?

Test code:

  Dictionary<string, string> test = new Dictionary<string, string>();
    test.Add("a", "b");

EDIT: I've just tried the same debug in a Console app and it works as expected. The other project is a Silverlight 4 application, why are they different?

Console Debug Screen Shot

Silverlight 4 Debug Screen Shot:

EDIT: Reply from Microsoft Connect: "This was an omission on our part - we had previously fixed this exact issue for Visual Studio 2008 SP1, but this fix was unfortunately not ported to the Visual Studio 2010 codebase. This is now fixed again (this time for good!) and we're looking into shipping this fix in VS2010 SP1.

Alex Turner Program Manager Visual Basic and C# Compiler" So it should be fixed soon.

EDIT: I've just double checked this in SP1 and it is working correctly.

解决方案

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.

这篇关于为什么字典调试可视化工具在Visual Studio 2010中用于Silverlight调试的用处不大?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆