Deserialization backwards compatibility

前端 未结 5 1345
刺人心
刺人心 2020-12-05 15:08

I am trying to deserialize \"SomeClass\" with an older version of an application. I get this below exception

System.Runtime.Serialization.Serializatio

5条回答
  •  鱼传尺愫
    2020-12-05 15:35

    As an advisory to people investigating this issue "before it is too late"... I strongly advise against persisting via BinaryFormatter. It is OK for transient transfer between 2 app-domains that are in sync, but that is about it IMO. Other serialization tools exist that don't have these issues. In terms of binary, protobuf-net is a pretty reasonable option - allowing add/remove/rename etc without pain.

提交回复
热议问题