I have an application that includes several serializable classes that are all
output using the SOAP formatter. Over the years, I've added several
OptionalFieldAt tributes to various members of the classes.
Now, on one particular class I'm trying to add an additional
OptionalFieldAt tribute, but when I deserialize the objects I get an
ArgumentNullExc eption 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:
<OptionalFieldA ttribute(Versio nAdded:=6)Priva te _Status As Integer
The top part of the stack trace includes the following:
at
System.Runtime. Serialization.F ormatterService s.PopulateObjec tMembers(Object
obj, MemberInfo[] members, Object[] data)
at
System.Runtime. Serialization.F ormatters.Soap. ReadObjectInfo. PopulateObjectM embers()
at
System.Runtime. Serialization.F ormatters.Soap. ObjectReader.Pa rseObjectEnd(Pa rseRecord pr)
at
System.Runtime. Serialization.F ormatters.Soap. ObjectReader.Pa rse(ParseRecord
pr)
at
System.Runtime. Serialization.F ormatters.Soap. SoapHandler.End Element(String
prefix, String name, String urn)
at System.Runtime. Serialization.F ormatters.Soap. SoapParser.Pars eXml()
at System.Runtime. Serialization.F ormatters.Soap. SoapParser.Run( )
at
System.Runtime. Serialization.F ormatters.Soap. ObjectReader.De serialize(Heade rHandler handler, ISerParser serParser)
at
System.Runtime. Serialization.F ormatters.Soap. SoapFormatter.D eserialize(Stre am
serializationSt ream, HeaderHandler handler)
at
System.Runtime. Serialization.F ormatters.Soap. SoapFormatter.D eserialize(Stre am
serializationSt ream)
at ... [my calling function]
I've found a similar post at
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
OptionalFieldAt tributes to various members of the classes.
Now, on one particular class I'm trying to add an additional
OptionalFieldAt tribute, but when I deserialize the objects I get an
ArgumentNullExc eption 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:
<OptionalFieldA ttribute(Versio nAdded:=6)Priva te _Status As Integer
The top part of the stack trace includes the following:
at
System.Runtime. Serialization.F ormatterService s.PopulateObjec tMembers(Object
obj, MemberInfo[] members, Object[] data)
at
System.Runtime. Serialization.F ormatters.Soap. ReadObjectInfo. PopulateObjectM embers()
at
System.Runtime. Serialization.F ormatters.Soap. ObjectReader.Pa rseObjectEnd(Pa rseRecord pr)
at
System.Runtime. Serialization.F ormatters.Soap. ObjectReader.Pa rse(ParseRecord
pr)
at
System.Runtime. Serialization.F ormatters.Soap. SoapHandler.End Element(String
prefix, String name, String urn)
at System.Runtime. Serialization.F ormatters.Soap. SoapParser.Pars eXml()
at System.Runtime. Serialization.F ormatters.Soap. SoapParser.Run( )
at
System.Runtime. Serialization.F ormatters.Soap. ObjectReader.De serialize(Heade rHandler handler, ISerParser serParser)
at
System.Runtime. Serialization.F ormatters.Soap. SoapFormatter.D eserialize(Stre am
serializationSt ream, HeaderHandler handler)
at
System.Runtime. Serialization.F ormatters.Soap. SoapFormatter.D eserialize(Stre am
serializationSt ream)
at ... [my calling function]
I've found a similar post at
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
Comment