I ran across something odd in VB.NET and wonder if anyone has seen such in VB.NET or C#.

VS 2010

.NET 3.5

Win 7

exe compiled as Any CPU

debugging 64 bit

 

If a dataset contains a datatable that has a column that is a DateTimeOffset and that dataset is remoted (in my case a web service passes the dataset to a client), stepping through the following code shows that variable dto is 1-1-0001 00:00:00 00:00 rather than the date from the datatable row.

However, rather than stepping through the code, if the code runs to a break point after this line of code the value of variable dto is correct.

 

For Each r As DataRow In SomeDataTable.Rows

Dim dto As System.DateTimeOffset = CType(r.Item("SomeDate"), System.DateTimeOffset)

.

.

.

Next

 

In the Immediate Window the "? dto" reported the invalid value if stepped through as well.  However, setting dto = CType(r.Item("SomeDate"), System.DateTimeOffset) in the Immediate Windows correctly set dto.

Odd.  It looks like a debugger only issue but was curious if anyone else has seen issues with remoted DateTimeOffset datacolumns.


EDIT: added .net 3.5