0

In case of versioning of object, if the old version object is serialized and now I need deserialized object of new version.

I have checked over internet and observed that we can use SerializationBinder for that purpose. But I have no idea how can I use this with DataContractSerialzer.

This binder can be assigned to the BinaryFormatter using Binder property.

Is anything similar present with the DataContractSerializer?

Please let me know if there is any other way to achieve this.

Please correct me, if I assumed anything wrong in this.

Sandip D
  • 103
  • 1
  • 14
  • 1
    `DataContract`s have a powerful versioning system. You should read [here](https://learn.microsoft.com/en-us/dotnet/framework/wcf/feature-details/data-contract-versioning) about it. – dymanoid Sep 14 '17 at 14:37
  • We need to see a [mcve] to answer the question. One mechanism similar to `Binder` is [`DataContractResolver`](https://blogs.msdn.microsoft.com/youssefm/2009/06/05/configuring-known-types-dynamically-introducing-the-datacontractresolver/). Another is the [data contract surrogate](https://learn.microsoft.com/en-us/dotnet/framework/wcf/extending/data-contract-surrogates). Or make the new contract be [data contract equivalent](https://learn.microsoft.com/en-us/dotnet/framework/wcf/feature-details/data-contract-equivalence) to the old, with the addition of some optional members. – dbc Sep 14 '17 at 17:26

0 Answers0