This section describes how persistent representations of objects are versioned: specifically, how we handle the case of version N+1 code decoding a representation created by encoding with version N of the same object class. That is, we support backward compatibility but not forward compatibility.
Binary formats support versioning through the binary serialization formatters. Version numbers correspond to versions of the runtime.
Security objects need to provide backward compatible conversion paths, and mark representations with necessary version information to satisfy the requirement stated at the top of this section. The standard way to associate version with the XML representation is with a version tag in the element with the class attribute. The class that implements ISecurityEncodable determines the form of the version attribute.
<Permission class=”Foo” version rev=”1.0.0.0”> … content is class-dependent … </Permission>
Versioning will detect if older code is ever asked to decode data from a newer version of the code that it cannot interpret. In this case, raise SerializationException. Note that some security objects may implement more sophisticated versioning as an extension on top of the basic versioning described here.