views:

82

answers:

1

We have serialized value of some objects persisted. Now we want to make substantial changes to some objects.

So what i want to do is load older version of object using old assembly then deserialize and serialize again with newer version of the object. I can have convert method which can transform old object to new one.

i have been converting object on fly on deserializer but in this case it's almost new object with same name.

A: 

So you just need a one time conversion, right? How about using XmlSerializer as the intermediate?

Kai Wang
Yes, one time conversion but it's a convertion from serialized binary to object to new object. So XmlSerializer can't help as i need to first deserialize object to older version using binary serializer.
mamu
deserialize the old binary using the old assembly; serialize the object to an xml; change the reference to the new assembly; deserialize the xml into the new type (may need to edit xml manually a little bit); serailize the new object to binary; now you get the new binary reflecting the new type
Kai Wang