CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2006
    Posts
    54

    multiple objects C# serialization

    I have an application which serializes several objects by iterating through them and giving the comand to the object to serialize itself into a stream.

    The problem is that now in the second version of the application some of the objects have more members, so the deserialization from former versions will give errors.

    I thought of using VTS but I am not sure it will work (most probably not). Anyone has any ideas how to fix this?

  2. #2
    Join Date
    Nov 2003
    Posts
    2,185

    Re: multiple objects C# serialization

    I wrote a class to avoid this problem. I have attached it (including a unit test that contains example code how to use it).
    Attached Files Attached Files

  3. #3
    Join Date
    Jan 2006
    Posts
    54

    Re: multiple objects C# serialization

    Thanks, but I don't think it will help much .

    The stream is binary, and is a stream provided by another application through COM. So I can't read what variable is coming, I just have to guess by the order that the objects were written. And to make matters worse, the version of the application was not saved in the serialization stream.
    I do not know what the original developer was thinking....

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured