Why are interfaces not [Serializable]?

Interfaces define a contract and do not have any state of their own.

Serialization is about saving and loading state into and out of an object model.

Not much point to serializing something that holds no state.


To answer the practical question of forcing an implementation of an interface to be Serializable – this is why the ISerializable interface exists.

In .NET you can declare an interface that should implement other interfaces:

interface MustBeSerializable : ISerializable {}

See some more information here.

Leave a Comment