Main contents

The Missing .NET #6: Version Tolerant Serialization

7 July 2008

In .NET 1.1, serialization (binary serialization, to be clear) is a bit hairy when you’re successful enough to ship multiple versions of your product and you don’t consider versioning until the first bug report about serialization problems. Changing the type, by either adding or removing fields, in .NET 1.1 causes previous versions of your type to lose their mind. The only way to deal with it was to implement ISerializable, which is fraught with problems, not the least of which is it makes you entirely responsible for serialization and deserialization of the whole type for ever and ever. When we found this out, this mass hysteria gripped us, so every serializable type had to implement ISerializable, even it were new to the next version, which is now a maintenance nightmare. We also got sloppy and applied the same boilerplate serialization code to every type. So we didn’t handle it well, but you didn’t really have a choice in .NET 1.1. Read more »

Posted in .NET, Missing .NET | 2 Comments »