根据这个问题的要求 Can the DebuggerDisplay attribute be applied to types one doesn't own,能否将
如果可以,有没有一种特定的方式将其应用于
我尝试了以下代码但没有成功:
DebuggerDisplay
属性应用于外部程序集中的类型?如果可以,有没有一种特定的方式将其应用于
Microsoft.Office.Interop.Word.Range
?
我尝试了以下代码但没有成功:
<Assembly: DebuggerDisplay("text: {Text}", Target:=GetType(Word.Range))>
在运行时调试器中会显示这个字符串:
{System.__ComObject}
但是'System.__ComObject'不可访问,因为它是'Friend'。
DebuggerDisplay
属性和DebuggerTypeProxy
。 - Jeroen Mostert