addresses/uniqueness not displayed in debugger

  • Thread starter Thread starter Warren Harris
  • Start date Start date
W

Warren Harris

I've been using Visual Studio .NET 2003 with C#, and I find it
annoying that some sort of address (unique id / hash code) isn't
displayed when objects are printed in the debugger (e.g.
{System.Data.DataRelation 235} rather than just
{System.Data.DataRelation}). Doing this would make it visibly apparent
that two objects were the same, and speed debugging.

Searching through this forum I found that you can compare two objects
for equality in the Watch window (obj1 == obj2), but I would really
like find some way to fix up the debugger's print routines if that's
possible. Any idea how to do this?

Warren
 
Hi Warren,
I thing the debugger shows the string that ToString() method produce. Try to
override this method in order to show whatever you want.

HTH
B\rgds
100
 
100 said:
Hi Warren,
I thing the debugger shows the string that ToString() method produce.
Try to override this method in order to show whatever you want.

It doesn't. See the \Program Files\Microsoft Visual Studio
..NET\Common7\Packages\Debugger\mcee_cs.dat file.

I agree with the OP though - it should display some kind of unique value for
each object.
 
Arild,

Thanks for pointing this out. However, I'm not sure the mcee_cs.dat file
is working for me. Looking at mine, it says that DataGrids print as
{Text=<Text>}:

<System.Windows.Forms.DataGrid=Text=<Text>

although mine clearly don't print that way. They're just
{System.Windows.Forms.DataGrid}. Any idea how to enable this?

But, even with this feature, it doesn't let me do what I'd really like
to do:

<System.Object>=hc=<GetHashCode>

since GetHashCode is a method, not a property.

Warren
 
Back
Top