1

Closed

Portable library fails to serialise DateTime's in MonoDroid

description

I'm trying to use the binary PortableLibrary in MonoDroid right now.
 
Overall it's working very well :)
 
When serialising a datetime, however, I hit a problem with Utc offset.
 
Sadly the tools won't let me get to the exact exception details right now, but I think the error is an ArgumentException that path2 is null in the following stack trace:
 
0x6 in Newtonsoft.Json.Utilities.DateTimeUtils.GetUtcOffset C#
0x3 in Newtonsoft.Json.JsonConvert.WriteDateTimeString  C#
0x22 in Newtonsoft.Json.JsonTextWriter.WriteValue   C#
0x166 in Newtonsoft.Json.JsonWriter.WriteValue  C#
0x52 in Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializePrimitive   C#
0xD7 in Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeValue   C#
0x76 in Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.WriteMemberInfoProperty  C#
0xD8 in Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeObject  C#
0xA5 in Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeValue   C#
0xBD in Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeList    C#
0xC2 in Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeValue   C#
0x1B in Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.Serialize    C#
0x12C in Newtonsoft.Json.JsonSerializer.SerializeInternal   C#
0x3 in Newtonsoft.Json.JsonSerializer.Serialize C#
0x2F in Newtonsoft.Json.JsonConvert.SerializeObject C#
 
I guess this is possibly a MonoDroid issue rather than a JSON.Net one.
 
Will try to post a repro sample soon
 
@slodge
Closed May 4, 2012 at 1:02 AM by JamesNK

comments

JamesNK wrote May 2, 2012 at 11:32 PM

If it works in .NET with the portable project but fails in MonoDroid then it is a MonoDroid bug.