I wanted to start a list of common reasons why Silverlight Serializer throws the MissingMethodException exception. First off you need to make sure you've got a WP7 build of the Silverlight Serializer - you can get a copy from the WP7Contrib code base if you don't want to build your own.
Classes causing MissingMethodException exception:
System.Uri,
System.Globalization.CultureInfo
To correct the issue for the above classes you will have to implement a classes that acts a serialization proxy, the one shown below is for System.Uri.
As said I'm going to try and keep this upto date as I come across framework classes not supported.
Classes causing MissingMethodException exception:
System.Uri,
System.Globalization.CultureInfo
To correct the issue for the above classes you will have to implement a classes that acts a serialization proxy, the one shown below is for System.Uri.
[Serializer(typeof(Uri))]
public sealed class SerializeUri : ISerializeObject
{
public object[] Serialize(object target)
{
return new object[] { ((Uri) target).ToString() };
}
public object Deserialize(object[] data)
{
return new Uri((string) data[0]);
}
}
As said I'm going to try and keep this upto date as I come across framework classes not supported.
hi, could you please test if SharpSerializer throws MissingMethodException as well?
ReplyDeleteWhat exactly do you mean, test which type?
ReplyDelete