views:

48

answers:

2

Hi all,

I have in my Visual Studio 2008 .NET C# project one property observed and debugger shows open and immediately closed curly brackets "{}". I believe it is uninitialized (I)List, but why it does not shows "null" or "unitialized". What does "{}" it means ?

br, Milan.

+2  A: 

The most likely reason is that the type of the value in question overrides the .ToString() method and returns an empty string. This will cause the display to be {} as the C# EE wraps the return of .ToString inside of {}'s

JaredPar
A: 

If you want to change the value shown in the debugger you can control it with the DebuggerDisplayAttribute. You could also override the .ToString() method instead. But this could affect other areas of your applications.

Matthew Whited