2

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.

Oded
  • 489,969
  • 99
  • 883
  • 1,009
mamu
  • 12,184
  • 19
  • 69
  • 92

1 Answers1

0

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

treehouse
  • 2,521
  • 1
  • 21
  • 39
  • 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 May 16 '10 at 16:10
  • 1
    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 – treehouse May 18 '10 at 12:42