LinkedList无法序列化?

iTa*_*ayb 3 c# xml-serialization

这是我的课程:http://pastebin.com/3dc5Vb1t

当我试图跑

BookStore b = new BookStore();
b.LoadFromXML(Server.MapPath("list.xml"));
Label1.Text = b.ToString();
Run Code Online (Sandbox Code Playgroud)

我收到以下错误:

您必须在System.Collections.Generic.LinkedList`1 [[Book,App_Code.cxsacizw,Version = 0.0.0.0,Culture = neutral,PublicKeyToken = null]]上实现默认访问器,因为它继承自ICollection.

错误来源是 XmlSerializer s = new XmlSerializer(typeof(BookStore));

当我试图在谷歌上寻找解决方案时,我发现LinkedList在序列化方面存在一些问题.我怎么处理它?

非常感谢你.

Nif*_*fle 5

看来这是不可能的.

Bug报告在这里:linkedlist-t-can-not-serialized-using-the-xmlserializer.在哪里可以阅读以下内容:

Microsoft于2004年11月11日19:35发布
我们因为性能原因选择不在LinkedList上使用索引器方法.所以LinkedList不是XMLSeriliazable.