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. legacy software

legacy software

Scheduled Pinned Locked Moved C#
jsonquestionannouncement
2 Posts 2 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.
  • B Offline
    B Offline
    bwagz
    wrote on last edited by
    #1

    Hi, Last year I created a program that uses binary serialization for file saving. In the near future I'm planning on creating a new revision of this program, which will include many class structure changes from the current version. It seems that when using object serialization, adding and changing variables to current classes will cause errors during deserialization of older files. Are there ways to allow files created by older software versions to be compatible with newer ones? This is an area of programming I've never really explored. I'm unsure of common practices. Thanks for any tips!

    D 1 Reply Last reply
    0
    • B bwagz

      Hi, Last year I created a program that uses binary serialization for file saving. In the near future I'm planning on creating a new revision of this program, which will include many class structure changes from the current version. It seems that when using object serialization, adding and changing variables to current classes will cause errors during deserialization of older files. Are there ways to allow files created by older software versions to be compatible with newer ones? This is an area of programming I've never really explored. I'm unsure of common practices. Thanks for any tips!

      D Offline
      D Offline
      Daniel1324
      wrote on last edited by
      #2

      If you're using C# 2005 you can use the [OptionalFieldAttribute] on new class variables, and when you deserialize the class, the vars that have the above tag wont be required and therefore wont throw an exception. If you're using C# 2003, you can look into manually controlling the serialization process. BTW: M$ is giving away C#, VB, and C++ express for free until Nov. 2006. If you get them before then, you will never have to pay for them. You can download CD images of each.

      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