U
Urs Vogel
Hi
I'm wondering if there's a technique to deserialize objects which were
serialized with an earlier version of the class. Example:
// version 1
class
{
string myString;
int myInt;
}
is serialized to myobject.xml
In an update version of my app, I need to deserialize the myobject.xml, but
my class has changed due to new app requirements:
// version 2
class
{
string myString;
int myInt;
bool myBool;
}
Now, it won't deserialize anymore. In order to guarantee product update
compatibility, do I have to maintain all previous versions of my serialized
classes in my app and do try-catch-try-catch blocks until the correct
version can be read?
Any hints are appreciated
Urs
I'm wondering if there's a technique to deserialize objects which were
serialized with an earlier version of the class. Example:
// version 1
class
{
string myString;
int myInt;
}
is serialized to myobject.xml
In an update version of my app, I need to deserialize the myobject.xml, but
my class has changed due to new app requirements:
// version 2
class
{
string myString;
int myInt;
bool myBool;
}
Now, it won't deserialize anymore. In order to guarantee product update
compatibility, do I have to maintain all previous versions of my serialized
classes in my app and do try-catch-try-catch blocks until the correct
version can be read?
Any hints are appreciated
Urs