I have an app that uses the SOAP serializer to serialize and deserialize a
object of a certain class to a file. The class implements ISerializable.
From time to time it is necessary to add or remove fields from the class.
I've been able to deserialize out-of-date versions by handling serialization
exceptions in Sub New(ByVal info As SerializationInfo, ByVal context As
StreamingContext).
I've now hit a problem. With the latest version, if I try to deserialize an
out-of-date XML file I get an exception *before* my constructor starts to
run. Visual Studio reports:
A first chance exception of type
'System.Runtime.Serialization.SerializationExcepti on' occurred in
system.runtime.serialization.formatters.soap.dll
The message is: Top Object cannot be instantiated for element 'mListColor'.
mListColor is a field that no longer exists; however even if I do the
obvious thing and add it back, I still get the same error.
The serialization and deserialization works fine with newly serialized
files; it is just deserializing the old version that is not working.
How can I troubleshoot this?
Thanks for any advice,
Tim