能否DebuggerDisplay属性应用到一个没有自己的类型? [英] Can the DebuggerDisplay attribute be applied to types one doesn't own?

查看:161
本文介绍了能否DebuggerDisplay属性应用到一个没有自己的类型?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我喜欢 DebuggerDisplay 属性。我喜欢它这么多,我想用它,我没有源$ C ​​$ C的类型。

I like the DebuggerDisplay attribute. I like it so much, that I want to use it on types that I don't have the source code for.

这可能吗?

推荐答案

是的。事实上,微软是太好,以使这个在Visual Studio中的内置选项。

Yes. In fact, Microsoft was so nice as to make this a built-in option in Visual Studio.

查找我的文档\ Visual Studio的20XX \ autoexp.cs为你如何运用DebuggerDisplay属性的外商到您的程序集类型的一些例子。然后,添加一些自己的,重新编译,并更换autoexp.dll,并重新启动Visual Studio。它应该只是工作。

Look up the "My Documents\Visual Studio 20XX\autoexp.cs" for some examples of how you apply the DebuggerDisplay attribute to types that are foreign to your assembly. Then, add some of your own, recompile it and replace the autoexp.dll, and restart Visual Studio. It should Just Work.

有关参考,请参阅黄色的注意段落这个MSDN文章

For reference, see the yellow "Note" paragraph in this MSDN article

编辑:我创建了一个商业扩展到Visual Studio 了能够做的这个少了很多做文章,甚至无需必须停止调试会话。 这里是展示如何更改调试器显示屏上的任何对象,第三方与否,与单一的视频点击。

I've created a commercial extension to Visual Studio that enables doing this with a lot less fuss, without even needing to have to stop the debugging session. Here is a video showing how you can change the debugger display on any object, 3rd party or not, with a single click.

这篇关于能否DebuggerDisplay属性应用到一个没有自己的类型?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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