Hello I'm new to C# and I'm trying to serialize some data. I have a base class, which implements ISerializable and more subclasses that extend the base class. In my base class I wrote this:
protected BaseClass(SerializationInfo info, StreamingContext context) { if (info == null) throw new System.ArgumentNullException("info"); } [SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.SerializationFormatter)] public virtual void GetObjectData(SerializationInfo info, StreamingContext context) { if (info == null) throw new System.ArgumentNullException("info"); } The problem is that when I run my program I get this error saying that my subclasses are not marked as serializable. It's a big project. I bassicaly have a student class class Student : ISerializable, which is the base class, and I have GraduateStudent : Student and PhDStudent : Student. When I try to serialize a list of students( can be Student, GraduateStudent or PhDStudent) I get the error above. I have also tried to write like this PhDStudent : Student,ISerializablebut no success
[Serializable]:)