对于 C# 中的调试器可视化工具,有什么简单的类似于为 C++ 编辑 autoexp.dat 吗?

Is there anything simple for debugger visualizers in C# that's analogous to editing autoexp.dat for C++?

我有一个 class 有几个简单的成员,我希望在 Visual Studio 2010 年向调试器公开这些成员。我想快速浏览一下这些类型的列表并避免所有变量值树的钻取和扩展。我希望有一些类似于在 C++ 中编辑 autoexp.dat 的东西可以快速完成。

为您的对象覆盖 ToString(),或使用 DebuggerDisplay(感谢 @gdir)。

If a C# object has an overridden ToString(), the debugger will call the override and show its result instead of the standard {}. Thus, if you have overridden ToString(), you do not have to use DebuggerDisplay. If you use both, the DebuggerDisplay attribute takes precedence over the ToString() override.