I'm writing some code to automatically parse/evaluate DebuggerDisplay
strings for unit testing purposes. I'm curious, does the ,nq
directive only have effect for strings? I see that if I write
[DebuggerDisplay("{c,nq}")]
public class D { public C c = new C(); }
public class C { }
Then a new D()
will present as {C}
in the debugger. Removing the ,nq
from the display string has the same effect. Only if I change the type of c
to a string, like this
[DebuggerDisplay("{c,nq}")]
public class D { public string c = "foo"; }
does removing/keeping ,nq
seem to have effect (it results in "foo"
and foo
, respectively). So does ,nq
only matter when you're trying to display a string field/member?