[Mono-dev] Remoting with DateTime

Jae Stutzman jaebird at gmail.com
Tue Aug 14 18:37:19 EDT 2007

Ok added bug# 82400 to help track this. I've been playing with Lionel's
patch. What i've found out so far is that the ObjectReader from
System.Runtime.Serialization.Formatters.Binary has a method that is executed
when trying to de-serialize the DateTime struct. The method is
ReadPrimitiveTypeValue, which has a case:

case TypeCode.DateTime:
     return new DateTime (reader.ReadInt64());

This is causing an explosion because now the DateTimeKind is included. This
is quite a mess at present. Needless to say if you try to remote a DateTime
that has a kind of Local or Utc it will die. The ObjectReader is not using
the ISerializable interface, just calling the DateTime ctor with "ticks",
but they are not ticks yet!

I'll keep looking, but someone familiar with why it was done this way should
speak up if possible.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20070814/fa43df43/attachment.html 

More information about the Mono-devel-list mailing list