[Mono-bugs] [Bug 339004] New: FormatException when XML-Deserializing DateTime.MinValue
bugzilla_noreply at novell.com
bugzilla_noreply at novell.com
Sun Nov 4 15:44:41 EST 2007
https://bugzilla.novell.com/show_bug.cgi?id=339004
Summary: FormatException when XML-Deserializing DateTime.MinValue
Product: Mono: Class Libraries
Version: 1.2
Platform: Other
OS/Version: Other
Status: NEW
Severity: Normal
Priority: P5 - None
Component: CORLIB
AssignedTo: mono-bugs at ximian.com
ReportedBy: daniel at hofmannmail.ath.cx
QAContact: mono-bugs at ximian.com
Found By: ---
Created an attachment (id=181953)
--> (https://bugzilla.novell.com/attachment.cgi?id=181953)
Reproduction of the output
Using Mono r88668 I'm getting a System.FormatException when deserializing
DateTime.MinValue. I've tested the same situation for some DateTime.Now-Values
and "DateTime.MinValue.AddTicks(1l)", which all work fine.
DateTime.MinValue, however, results in:
<?xml version="1.0" encoding="utf-16"?>
<dateTime>0001-01-01T00:00:00</dateTime>
Unhandled Exception: System.FormatException: Invalid format.
at System.DateTime.ParseExact (System.String s, System.String[] formats,
IFormatProvider fp, DateTimeStyles style) [0x00059] in
/home/dani/src/mono/mcs/class/corlib/System/DateTime.cs:1791
at System.DateTime.ParseExact (System.String s, System.String format,
IFormatProvider fp, DateTimeStyles style) [0x0001c] in
/home/dani/src/mono/mcs/class/corlib/System/DateTime.cs:1770
at System.Xml.XmlConvert.ToDateTime (System.String s, System.String format)
[0x00002] in
/home/dani/src/mono/mcs/class/System.XML/System.Xml/XmlConvert.cs:321
at System.Xml.XmlConvert.ToDateTime (System.String value,
XmlDateTimeSerializationMode mode) [0x00059] in
/home/dani/src/mono/mcs/class/System.XML/System.Xml/XmlConvert.cs:304
at System.Xml.Serialization.XmlCustomFormatter.FromXmlString
(System.Xml.Serialization.TypeData type, System.String value) [0x00071] in
/home/dani/src/mono/mcs/class/System.XML/System.Xml.Serialization/XmlCustomFormatter.cs:274
at System.Xml.Serialization.XmlSerializationReader.ReadTypedPrimitive
(System.Xml.XmlQualifiedName qname, Boolean reportUnknown) [0x0018f] in
/home/dani/src/mono/mcs/class/System.XML/System.Xml.Serialization/XmlSerializationReader.cs:788
at System.Xml.Serialization.XmlSerializationReader.ReadTypedPrimitive
(System.Xml.XmlQualifiedName qname) [0x00000] in
/home/dani/src/mono/mcs/class/System.XML/System.Xml.Serialization/XmlSerializationReader.cs:751
at
System.Xml.Serialization.XmlSerializationReaderInterpreter.ReadPrimitiveElement
(System.Xml.Serialization.XmlTypeMapping typeMap, Boolean isNullable) [0x00025]
in
/home/dani/src/mono/mcs/class/System.XML/System.Xml.Serialization/XmlSerializationReaderInterpreter.cs:802
at System.Xml.Serialization.XmlSerializationReaderInterpreter.ReadObject
(System.Xml.Serialization.XmlTypeMapping typeMap, Boolean isNullable, Boolean
checkType) [0x0004f] in
/home/dani/src/mono/mcs/class/System.XML/System.Xml.Serialization/XmlSerializationReaderInterpreter.cs:196
at System.Xml.Serialization.XmlSerializationReaderInterpreter.ReadRoot
(System.Xml.Serialization.XmlTypeMapping rootMap) [0x00057] in
/home/dani/src/mono/mcs/class/System.XML/System.Xml.Serialization/XmlSerializationReaderInterpreter.cs:184
at System.Xml.Serialization.XmlSerializationReaderInterpreter.ReadRoot ()
[0x00028] in
/home/dani/src/mono/mcs/class/System.XML/System.Xml.Serialization/XmlSerializationReaderInterpreter.cs:87
at System.Xml.Serialization.XmlSerializer.Deserialize
(System.Xml.Serialization.XmlSerializationReader reader) [0x0001c] in
/home/dani/src/mono/mcs/class/System.XML/System.Xml.Serialization/XmlSerializer.cs:360
--
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.
More information about the mono-bugs
mailing list