SoapFormatter throws System.Exception when deserializing non-compatible versions

C

Chris Newby

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//
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top