Steve Teeples <(E-Mail Removed)> wrote:
> How would you go about adding support for deserializing older versions of the
> saved data? This is the exact problem I am having. I saved data several
> days ago and added a field to my class. Now when deserializing I get an
> exception error. Do you have an example of how this solution can be
> implemented? Help would be greatly appreciated as resolving this issue is
> critical to my application.
Unfortunately I don't know much about binary formatting - I suspect
that without having already put in support in the old code for
specifically serializing in a known format, you may well be stuck.
When you say it's critical to your application, do you mean the ability
to add to your class and still be able to deserialize is critical, or
just to extract this data? If it's the latter, I'd suggest going back
to an older version of the class, deserialising and saving the data in
another (more explicit) way, then putting the fields back in, loading
the data again and reserializing.
--
Jon Skeet - <(E-Mail Removed)>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too