Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Deserialize from 2.0 to 1.1 framework

Deserialize from 2.0 to 1.1 framework

Scheduled Pinned Locked Moved C#
questionsales
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    nryk
    wrote on last edited by
    #1

    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 ?

    OriginalGriffO H 2 Replies Last reply
    0
    • N nryk

      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 ?

      OriginalGriffO Offline
      OriginalGriffO Offline
      OriginalGriff
      wrote on last edited by
      #2

      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

      "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
      "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

      N 1 Reply Last reply
      0
      • OriginalGriffO OriginalGriff

        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

        N Offline
        N Offline
        nryk
        wrote on last edited by
        #3

        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.

        OriginalGriffO 1 Reply Last reply
        0
        • N nryk

          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.

          OriginalGriffO Offline
          OriginalGriffO Offline
          OriginalGriff
          wrote on last edited by
          #4

          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 have no idea what I did, but I'm taking full credit for it." - ThisOldTony
          "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

          1 Reply Last reply
          0
          • N nryk

            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 ?

            H Offline
            H Offline
            Henry Minute
            wrote on last edited by
            #5

            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.”

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups