J
Jason
I have an application that includes several serializable classes that are all
output using the SOAP formatter. Over the years, I've added several
OptionalFieldAttributes to various members of the classes.
Now, on one particular class I'm trying to add an additional
OptionalFieldAttribute, but when I deserialize the objects I get an
ArgumentNullException with a message of: "Member at position 22 was null."
I can move the new field to a different class and everything works just
fine. This error only happens in the single class where I need this new
attribute.
This is the 8th OptionalField to be added to the class. The actual code is
as follows:
<OptionalFieldAttribute(VersionAdded:=6)> Private _Status As Integer
The top part of the stack trace includes the following:
at
System.Runtime.Serialization.FormatterServices.PopulateObjectMembers(Object
obj, MemberInfo[] members, Object[] data)
at
System.Runtime.Serialization.Formatters.Soap.ReadObjectInfo.PopulateObjectMembers()
at
System.Runtime.Serialization.Formatters.Soap.ObjectReader.ParseObjectEnd(ParseRecord pr)
at
System.Runtime.Serialization.Formatters.Soap.ObjectReader.Parse(ParseRecord
pr)
at
System.Runtime.Serialization.Formatters.Soap.SoapHandler.EndElement(String
prefix, String name, String urn)
at System.Runtime.Serialization.Formatters.Soap.SoapParser.ParseXml()
at System.Runtime.Serialization.Formatters.Soap.SoapParser.Run()
at
System.Runtime.Serialization.Formatters.Soap.ObjectReader.Deserialize(HeaderHandler handler, ISerParser serParser)
at
System.Runtime.Serialization.Formatters.Soap.SoapFormatter.Deserialize(Stream
serializationStream, HeaderHandler handler)
at
System.Runtime.Serialization.Formatters.Soap.SoapFormatter.Deserialize(Stream
serializationStream)
at ... [my calling function]
I've found a similar post at
http://social.msdn.microsoft.com/Fo.../thread/158d3eae-bc11-4265-994d-ce25f16af0e7/
that did not include a resolution to the problem either.
I'm trying to figure out how to handle this issue so I can serialize this
additional field correctly and handle previously saved data files.
Jason
output using the SOAP formatter. Over the years, I've added several
OptionalFieldAttributes to various members of the classes.
Now, on one particular class I'm trying to add an additional
OptionalFieldAttribute, but when I deserialize the objects I get an
ArgumentNullException with a message of: "Member at position 22 was null."
I can move the new field to a different class and everything works just
fine. This error only happens in the single class where I need this new
attribute.
This is the 8th OptionalField to be added to the class. The actual code is
as follows:
<OptionalFieldAttribute(VersionAdded:=6)> Private _Status As Integer
The top part of the stack trace includes the following:
at
System.Runtime.Serialization.FormatterServices.PopulateObjectMembers(Object
obj, MemberInfo[] members, Object[] data)
at
System.Runtime.Serialization.Formatters.Soap.ReadObjectInfo.PopulateObjectMembers()
at
System.Runtime.Serialization.Formatters.Soap.ObjectReader.ParseObjectEnd(ParseRecord pr)
at
System.Runtime.Serialization.Formatters.Soap.ObjectReader.Parse(ParseRecord
pr)
at
System.Runtime.Serialization.Formatters.Soap.SoapHandler.EndElement(String
prefix, String name, String urn)
at System.Runtime.Serialization.Formatters.Soap.SoapParser.ParseXml()
at System.Runtime.Serialization.Formatters.Soap.SoapParser.Run()
at
System.Runtime.Serialization.Formatters.Soap.ObjectReader.Deserialize(HeaderHandler handler, ISerParser serParser)
at
System.Runtime.Serialization.Formatters.Soap.SoapFormatter.Deserialize(Stream
serializationStream, HeaderHandler handler)
at
System.Runtime.Serialization.Formatters.Soap.SoapFormatter.Deserialize(Stream
serializationStream)
at ... [my calling function]
I've found a similar post at
http://social.msdn.microsoft.com/Fo.../thread/158d3eae-bc11-4265-994d-ce25f16af0e7/
that did not include a resolution to the problem either.
I'm trying to figure out how to handle this issue so I can serialize this
additional field correctly and handle previously saved data files.
Jason