Non strict serialization/deserialization
-
Is there any kind of serializer in .net that can be used to load and save object graphs w/o barfing if unexpected/old elements exist in the serialized data? I simply want to ignore field/property names that no longer exist in the serialized classes. such field should simply be set to their default values. XmlSerializer won't cut it since it only handles hierarchies and real graphs. SoapFormatter seems like it always crash if unexpected elements are found. I do know I can implement ISerializable but Im trying to avoid that, I want it to be easy to plug in new elements in the save file in this use case. I'm hoping there might be some nifty stuff in WCF for this, or that it might be possible to handle this with the soapformatter. any ideas?
Blog: http://www.rogeralsing.com Projects: http://www.puzzleframework.com
-
Is there any kind of serializer in .net that can be used to load and save object graphs w/o barfing if unexpected/old elements exist in the serialized data? I simply want to ignore field/property names that no longer exist in the serialized classes. such field should simply be set to their default values. XmlSerializer won't cut it since it only handles hierarchies and real graphs. SoapFormatter seems like it always crash if unexpected elements are found. I do know I can implement ISerializable but Im trying to avoid that, I want it to be easy to plug in new elements in the save file in this use case. I'm hoping there might be some nifty stuff in WCF for this, or that it might be possible to handle this with the soapformatter. any ideas?
Blog: http://www.rogeralsing.com Projects: http://www.puzzleframework.com