I have often used DebuggerDisplay, which I find very helpful during debugging, particularly in lists of objects.
Recently I am plagued by erroneous behaviour which I have never seen before.
Here is a simplified version of the class concerned.
[DebuggerDisplay("{Property1} | Property2 = {Property2}")]
public class Class1
{
public string Property1 { get; set; }
public decimal Property2 { get; set; }
public decimal? Property3 { get; set; }
}
The point is: I don’t get the intended DebuggerDisplay, but something that would come down to the string below.
[DebuggerDisplay("Property3 = {Property3}")]
I suspected that string was defined somewhere else, but could not find any of that.
It’s remarkable that it is the LAST property which is displayed.
But on the other hand, when opening the object in the debugger, that property is shown FIRST, with the other ones in alphabetical order.
There are other (generated) definitions of the same class in other namespaces. But I don’t see any DebuggerDisplay or differences in definition (order).
Can anyone explain this behaviour, and how to get what I want?
Thanks.
1