+2009-07-22 Atsushi Enomoto <atsushi@ximian.com>
+
+ * XmlFormatterDeserializer.cs : when reading empty primitive value,
+ make sure to consume the reader. Fixed bug #524083.
+
2009-07-22 Atsushi Enomoto <atsushi@ximian.com>
* SerializationMap.cs : call MoveToContent() before examining
if (KnownTypeCollection.GetPrimitiveTypeFromName (graph_qname.Name) != null) {
string value;
if (reader.IsEmptyElement) {
+ reader.Read (); // advance
if (type.IsValueType)
return Activator.CreateInstance (type);
else
+2009-07-22 Atsushi Enomoto <atsushi@ximian.com>
+
+ * XmlObjectSerializerTest.cs : add test for bug #524083, by
+ Rolf Bjarne Kvinge.
+
2009-07-22 Atsushi Enomoto <atsushi@ximian.com>
* XmlObjectSerializerTest.cs : now we can make xml indented as
}
}
+ [Test]
+ public void Bug524083 ()
+ {
+ string xml = @"
+<AsxEntryInfo xmlns='http://example.com/schemas/asx'>
+ <AdvertPrompt/>
+</AsxEntryInfo>";
+
+ using (XmlReader reader = XmlReader.Create (new StringReader (xml)))
+ new DataContractSerializer(typeof (AsxEntryInfo)).ReadObject (reader);
+ }
+
private T Deserialize<T> (string xml)
{
return Deserialize<T> (xml, typeof (T));
public PartDummyEntryInfo() {}
}
-
+[DataContract(Namespace="http://example.com/schemas/asx")]
+public class AsxEntryInfo
+{
+ [DataMember]
+ public string AdvertPrompt { get; set; }
+}