Is it possible to call a method with parameter(s) within the DebuggerDisplay attribute? I did not find helpful information for this problem in the MSDN article Using the DebuggerDisplay Attribute.
I try to call the ToString
method with a string parameter "d"
; but the following did not work:
[DebuggerDisplay(@"{ToString(""d"")}")]
public class ...
I know it is recommended to use a private property instead of complex expressions. But is it nevertheless possible with an expression?
I don't think it will allow that. But why cant you do this:
[DebuggerDisplay(@"{DebugDisplay}")]
public class ...
private string DebugDisplay
{
get
{
return ToString("d");
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With