Name Property
Collapse the table of content
Expand the table of content

DebuggerDisplayAttribute.Name Property


Gets or sets the name to display in the debugger variable windows.

Namespace:   System.Diagnostics
Assembly:  mscorlib (in mscorlib.dll)

Public Property Name As String

Property Value

Type: System.String

The name to display in the debugger variable windows.

The value can contain curly braces ({ and }). Text within a pair of braces is evaluated as the name of a field, property, or method.

The following code example causes the name and value of each key to be displayed in the debugger variable windows. When the attribute is not applied, the index and value type are displayed (for example: "[0] {KeyValuePairs}"). When the attribute is applied, the name of the key and its value are displayed (for example, if the first key is "one" and its value is 1, the display is: "one 1"). This code example is part of a larger example provided for the DebuggerDisplayAttribute class.

<DebuggerDisplay("{value}", Name := "{key}")>  _
Friend Class KeyValuePairs
    Private dictionary As IDictionary
    Private key As Object
    Private value As Object

    Public Sub New(ByVal dictionary As IDictionary, ByVal key As Object, ByVal value As Object) 
        Me.value = value
        Me.key = key
        Me.dictionary = dictionary

    End Sub 'NewNew
End Class 'KeyValuePairs

Universal Windows Platform
Available since 4.5
.NET Framework
Available since 2.0
Portable Class Library
Supported in: portable .NET platforms
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Windows Phone
Available since 8.1
Return to top
© 2015 Microsoft