Incorrect String Debug/Watch Info

  • Thread starter Thread starter OvErboRed
  • Start date Start date
O

OvErboRed

It's possible to print out a string's Length property in my code like so:

string asdf = "asdf\0asdf";
Console.WriteLine(asdf); // = "asdf asdf"
Console.WriteLine(asdf.Length); // = 9

However if you try to use the VS.NET debugger's Watch to inspect this,
you'll see that asdf is displayed as "asdf" and asdf.Length is displayed as
4, not 9.

Now I can understand (though not approve of) the IDE's inability to display
the former correctly. However, why doesn't the IDE read from the actual
Length property of the asdf String object (and instead re-calculate the
length on its own)?

And will any of these problems be fixed?
 
OvErboRed said:
It's possible to print out a string's Length property in my code like so:

string asdf = "asdf\0asdf";
Console.WriteLine(asdf); // = "asdf asdf"
Console.WriteLine(asdf.Length); // = 9

However if you try to use the VS.NET debugger's Watch to inspect this,
you'll see that asdf is displayed as "asdf" and asdf.Length is displayed as
4, not 9.

Now I can understand (though not approve of) the IDE's inability to display
the former correctly. However, why doesn't the IDE read from the actual
Length property of the asdf String object (and instead re-calculate the
length on its own)?

And will any of these problems be fixed?

I thought these problems were fixed in VS.NET 2003 - which version are
you using?
 
I'm using the original VS.NET. Is there an (official) comprehensive list of
bugs found/fixed anywhere?
 
OvErboRed said:
I'm using the original VS.NET. Is there an (official) comprehensive list of
bugs found/fixed anywhere?

Not that I've seen, I'm afraid - although that doesn't mean there isn't
one somewhere.
 
Back
Top