LinkedList cannot be serialised?
- by iTayb
Here are my classes: http://pastebin.com/3dc5Vb1t
When I try to run
BookStore b = new BookStore();
b.LoadFromXML(Server.MapPath("list.xml"));
Label1.Text = b.ToString();
I get the following error:
You must implement a default accessor on System.Collections.Generic.LinkedList`1[[Book, App_Code.cxsacizw, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]] because it inherits from ICollection.
The error source is XmlSerializer s = new XmlSerializer(typeof(BookStore));
When I tried to look for a solution on google, I found it that LinkedList has some problems with serialization. How can I deal with it?
Thank you very much.