Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //to avoid cross-versioning problems
- public sealed class CrossVersionDeserializationBinder : SerializationBinder {
- public override Type BindToType(string assemblyName, string typeName) {
- Type typeToDeserialize = null;
- typeToDeserialize = Type.GetType(String.Format("{0}, {1}",
- typeName, assemblyName));
- return typeToDeserialize;
- }
- }
- [ProtoContract]
- public class Foo {
- [ProtoMember(1)]
- public string Bar {get;set;}
- }
- [ProtoContract]
- public class a12 {
- [ProtoMember(1)]
- public string a {get;set;}
- }
- [DataContract]
- public class a12 {
- [DataMember(Name="Bar")]
- public string a {get;set;}
- }
Add Comment
Please, Sign In to add comment