[Mono-bugs] [Bug 378696] XmlSerializer: Error while compiling generated serializer
bugzilla_noreply at novell.com
bugzilla_noreply at novell.com
Thu Apr 10 09:24:30 EDT 2008
https://bugzilla.novell.com/show_bug.cgi?id=378696
User david.brazier at 360crm.co.uk added comment
https://bugzilla.novell.com/show_bug.cgi?id=378696#c4
--- Comment #4 from David Brazier <david.brazier at 360crm.co.uk> 2008-04-10 07:24:29 MST ---
See attached test program & XmlSerializer output, produced with the environment
variables set as advised. Problem is evidently with a DefaultValue of DateTime
type:
ob. at FancyDateTime = 02/03/2001 04:05:06;
The constant value is output by SerializationCodeGenerator.GetLiteral, which
doesn't have a special case for DateTime, so drops through to
IFormattable.ToString. Maybe this should use IConvertible and Convert instead?
As an aside, I ran the program with the MS runtime and got the output:
<?xml version="1.0" encoding="utf-16"?>
<Test xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<SimpleDateTime>0001-01-01T00:00:00</SimpleDateTime>
<FancyDateTime>0001-01-01T00:00:00</FancyDateTime>
</Test>
-----
01/01/0001 00:00:00
01/01/0001 00:00:00
The serialisation is as expected, becuase I didn't actually initialise the
FancyDateTime memeber to the same as the DefaultValue, but the deserialisation
isn't what I expected - it didn't respect the DefaultValue. Or perhaps I am
misunderstanding how DefaultValue is supposed to work. This isn't your problem
though!
--
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