I have the following code which works in non-silverlight code but gives an exception (There is an error in XML document (5, 14)) in silverlight. Can anyone tell me how to fix this?
int[] body = { 1, 2 };
MemoryStream ms0 = new MemoryStream();
XmlSerializer serializer = new XmlSerializer(body.GetType());
serializer.Serialize(ms0, body);
byte[] ResponseBody = ms0.GetBuffer();
//now try to deserialize
MemoryStream ms1 = new MemoryStream();
ms1.Write(ResponseBody, 0, ResponseBody.Length);
XmlSerializer xmlSerializer1= new XmlSerializer(typeof(int[]));
ms1.Seek(0, SeekOrigin.Begin);
int[] b= xmlSerializer1.Deserialize(ms1) as int[];
adsami
0 Points
3 Posts
XMLSerialization problem in silverlight
Jan 16, 2009 05:45 PM | LINK
I have the following code which works in non-silverlight code but gives an exception (There is an error in XML document (5, 14)) in silverlight. Can anyone tell me how to fix this?
andrejt
Participant
902 Points
141 Posts
Re: XMLSerialization problem in silverlight
Jan 17, 2009 08:03 AM | LINK
Hi,
how about:
MVP - Client Application Development | Blog | Twitter