Deserialize from 2.0 to 1.1 framework
-
i'm using 1.1 framework and my customer using 2.00 framework. he is saveing a Serialized file that have MemoryStream. when i'm trying to Deserialize the file i get an Exception. (if i try to Deserialize in 2.00 framework it's ok) how can i Deserialize in 1.1 framework ?
-
i'm using 1.1 framework and my customer using 2.00 framework. he is saveing a Serialized file that have MemoryStream. when i'm trying to Deserialize the file i get an Exception. (if i try to Deserialize in 2.00 framework it's ok) how can i Deserialize in 1.1 framework ?
Which serializer are you using? If it is XML, then you stand a chance of reading different framework versions, but Binary is very unlikely to work. This is an unusual situation, the normal way round is for the customer to have the more outdated software! There are two ways I can think of: 1) Install framework 2.0 - this would be the better long term solution. In fact, go the whole hog and go for the latest version! 2) Create a 2.0 version of your app, deserialize. Manually write all the important data to a separate file. Create a special version of your 1.1 app, which can read the separate file. Serialize. Do not loose the two intermediate programs as you will need them again if you do. Create copious notes on what to do, how, and why.
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced. This message is made of fully recyclable Zeros and Ones
-
Which serializer are you using? If it is XML, then you stand a chance of reading different framework versions, but Binary is very unlikely to work. This is an unusual situation, the normal way round is for the customer to have the more outdated software! There are two ways I can think of: 1) Install framework 2.0 - this would be the better long term solution. In fact, go the whole hog and go for the latest version! 2) Create a 2.0 version of your app, deserialize. Manually write all the important data to a separate file. Create a special version of your 1.1 app, which can read the separate file. Serialize. Do not loose the two intermediate programs as you will need them again if you do. Create copious notes on what to do, how, and why.
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced. This message is made of fully recyclable Zeros and Ones
-
the file is Binary. the problem is that my program is distribute to a lot of people, and i have a problem when tomorrow microsoft develop 4.00 or 5.00 or 6.00 framework version, and i can't compatible my old version to the new one.
Then you realy have no choice but to create intermediate programs to use to solve the problem each time it occurs. I would strongly suggest you look at moving to XML serialization for the next version, with a conversion program to update older data files from 1.1 (or 2.0) to the latest version. Not that it's a lot of help to you, but I do generaly try to avoid serialization for just this reason - it's not always avoidable, so use the most portable version you can! Good luck!
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced. This message is made of fully recyclable Zeros and Ones
-
i'm using 1.1 framework and my customer using 2.00 framework. he is saveing a Serialized file that have MemoryStream. when i'm trying to Deserialize the file i get an Exception. (if i try to Deserialize in 2.00 framework it's ok) how can i Deserialize in 1.1 framework ?
Take a look at Custom Serialization - MSDN[^] to see if it is of any help. From the page.
By controlling serialization, it is possible to ensure serialization compatibility, which is the ability to serialize and deserialize between versions of a type without breaking the core functionality of the type.
Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”