Deserialize old versions
-
I have a program that I didn't write, but maintain. Recently the assembly version was incremented to 1.0.1.0 and when it tries to load serialized objects (binary formatter) that were made with 1.0.0.0 I get an InvalidCastException. There was nothing changed in these on the objects themselves so there should be really need to be a cast.
-
I have a program that I didn't write, but maintain. Recently the assembly version was incremented to 1.0.1.0 and when it tries to load serialized objects (binary formatter) that were made with 1.0.0.0 I get an InvalidCastException. There was nothing changed in these on the objects themselves so there should be really need to be a cast.
Maybe use a SerializationBinder[^]? Mark
Mark Salsbery Microsoft MVP - Visual C++ :java:
-
Maybe use a SerializationBinder[^]? Mark
Mark Salsbery Microsoft MVP - Visual C++ :java:
Thanks for the reply. Because there was no actual change in the class (just version) I was able to just change the Version number listed in the binary file to the new version and it cast fine from there on out.