R
rich.quackenbush
I was very excited when version 2.0 of the framework came out... it
looked as though the OptionalField atribute would help me sort out my
serialization woes. So far, it hasn't through.
All I'm trying to do is add fields to objects which have already been
serialized. For example, I have serialized this object (and
deserialized successfully):
[Serializable()]
class Person
{
private string _FirstName = "";
private string _LastName = "";
... Public Properties omitted
}
I then added a field marked with the OptionalField attribute
[Serializable()]
class Person
{
private string _FirstName = "";
private string _LastName = "";
[System.Runtime.Serialization.OptionalField]
private string _Title = "";
... Public Properties omitted
}
I then got the old "Wrong number of Members. Object SqlXMLTest.Person
has 5 members, number of members deserialized is 4." exception.
I thought that the OptionalField attribute was designed to solve this
exact problem. Has anyone seen this?
BTW - I'm using the SOAPFormatter.
Thanks,
-Rich
looked as though the OptionalField atribute would help me sort out my
serialization woes. So far, it hasn't through.
All I'm trying to do is add fields to objects which have already been
serialized. For example, I have serialized this object (and
deserialized successfully):
[Serializable()]
class Person
{
private string _FirstName = "";
private string _LastName = "";
... Public Properties omitted
}
I then added a field marked with the OptionalField attribute
[Serializable()]
class Person
{
private string _FirstName = "";
private string _LastName = "";
[System.Runtime.Serialization.OptionalField]
private string _Title = "";
... Public Properties omitted
}
I then got the old "Wrong number of Members. Object SqlXMLTest.Person
has 5 members, number of members deserialized is 4." exception.
I thought that the OptionalField attribute was designed to solve this
exact problem. Has anyone seen this?
BTW - I'm using the SOAPFormatter.
Thanks,
-Rich