I serialize a class which includes a property called Model
as IModel
but when I try to Deserialize it I'm getting the following exception:
System.Runtime.Serialization.SerializationException: Type 'MYN.IModel' in Assembly 'MYN.Defs, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' is not marked as serializable.
It's binary serialization. Model
marked as serializable. Obviously IModel is not.
So what's the solution, what am I doing wrong? Why does it try to seriliaze or deserialize an interface anyway?
P.S. Interface hasn't got an Enum in it.