VisualStudio debug Array tooltip class value
When debugging in VisualStudio...
When hovering the mouse over an array of custom class types and it lists the array by showing the full namespace path to the type for each array item, which is worthless.
I'm pretty sure I've seen an attribute you can put at the top of the class definition that will then show that property value instead. Can anyone point me in the right direction?
Answers
If you have an array of SomeType, you want to put the DebuggerDisplayAttribute on the SomeType class declaration.
[DebuggerDisplay("X={X}, Y={Y}, Count={Count}")] public class SomeType { ... }
Then when you hover over a variable of type SomeType[], and expand the tooltip to see the elements, each one will show up as something like X=1, Y=13, Count=142.