SoapFormatter throws System.Exception when deserializing non-compatible versions

Discussion in 'ASP .Net' started by Chris Newby, May 16, 2005.

  1. Chris Newby

    Chris Newby Guest

    Given:

    public class MyClass{
    public String MyPropertyOne;
    }

    I have a soap document created by serializing an instance of a previous
    version of MyClass. However, now MyClass looks like:

    public class MyClass{
    public String MyPropertyOne;
    public String MyPropertyTwo;
    }

    If I now use the SoapFormatter to deserialize the older instance of MyClass,
    I get an exception that looks like:

    "Wrong number of Members. Object MyClass has 2 members, number of members
    deserialized is 1"

    I would like the older instance to continue deserializing, even though it
    might not be "binary compatible". Is there an easy way to do this?

    TIA//
    Chris Newby, May 16, 2005
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Chris Miller
    Replies:
    4
    Views:
    13,285
    Chris Smith
    Nov 22, 2003
  2. =?Utf-8?B?TWFydHluIEZld3RyZWxs?=

    SoapFormatter only works in Full Trust?

    =?Utf-8?B?TWFydHluIEZld3RyZWxs?=, May 5, 2007, in forum: ASP .Net
    Replies:
    5
    Views:
    344
    Walter Wang [MSFT]
    May 14, 2007
  3. Replies:
    0
    Views:
    601
  4. Ram

    SoapFormatter In WebService

    Ram, Mar 2, 2006, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    150
  5. pantagruel
    Replies:
    0
    Views:
    226
    pantagruel
    Feb 17, 2006
Loading...

Share This Page