Possible Duplicate:
Serializable Inheritance
Is serialization inheritable?
Example:
[Serializable]
class A
{
}
class B : A
{
}
If I try to serialize/deserialize an instance of class B, I get an exception stating that the class is not marked as serializable. Thus the question: is serialization inheritable? Am I just missing how to do it, or does every class that needs to be serialized require explicitly being marked as such?
It’s not inheritable:
You should mark the subclass as well to make it serializable: