[Mono-bugs] [Bug 660424] Problems Deserializing DateTime From MS.NET

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Sat Dec 18 12:50:44 EST 2010


https://bugzilla.novell.com/show_bug.cgi?id=660424

https://bugzilla.novell.com/show_bug.cgi?id=660424#c1


--- Comment #1 from Karsten Fourmont <fourmont at gmx.de> 2010-12-18 17:50:43 UTC ---
Some more digging revealed a proposed fix.

For deserialization:

in
\mono\mcs\class\System.Runtime.Serialization\System.Xml\XmlBinaryDictionaryReader.cs
change in ReadTextOrValue (byte ident, NodeInfo node, bool canSkip)
  node.TypedValue = new DateTime (source.Reader.ReadInt64 ());
to
  node.TypedValue = DateTime.FromBinary (source.Reader.ReadInt64 ());

and for serialization change in XmlBinaryDictionaryWriter.cs 

void WriteValueContent (DateTime value)
{
   writer.Write (value.Ticks);
}
to
void WriteValueContent (DateTime value)
{
   writer.Write (value.ToBinary());
}

However I can't say wheter this kind of "tick only serialization" occurs
anywhere else in Mono. should be changed there, too

Sorry for not providing proper patch. I'm new to git.

-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.


More information about the mono-bugs mailing list