I'm attempting to re-organize my application's namespace hierarchy, so I'm using a System.Runtime.Serialization.SerializationBinder
sub-class to attempt to handle the renaming. (Most of my renamed classes are correctly deserialized into their new namespaces without problems.)
The problem I have is that one of my serialized classes (which implements INotifyPropertyChanged
) failed to mark the PropertyChanged
event as [field:NonSerialized]
(oops), so legacy files are holding on to a reference to the legacy Type
for that class (through the serialized delegate).
I've implemented ISerializable
on the renamed class in an attempt to avoid deserializing the PropertyChanged
event, but that doesn't appear to have worked--an attempt to instantiate the old (renamed) class still occurs.
How do I force the BinaryFormatter
to avoid attempting to deserialize delegates?