Skip to main content

Generate property for DebuggerDisplay attribute

PropertyValue
IdRR0204
Applicable SyntaxDebuggerDisplay attribute
Enabled by Default

Usage

Example #1

before.cs
[DebuggerDisplay("A: {A} B: {B}")]
public class Foo
{
public string A { get; }
public string B { get; }
}
after.cs
DebuggerDisplay("{DebuggerDisplay,nq}")]
public class Foo
{
public string A { get; }
public string B { get; }

[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private string DebuggerDisplay
{
get { return $"A: {A} B: {B}"; }
}
}

Configuration

roslynator_refactoring.generate_property_for_debuggerdisplay_attribute.enabled = true|false

See Also