嗨,我想序列化
FileStream fileStream = new FileStream("batches.xml", FileMode.Open); XmlSerializer serializer = new XmlSerializer(typeof(List)); List listOfBatches = new List (); [Serializable] [XmlRoot("Batch")] public class Batche { [XmlElement("Title")] public string Title { get;set; } [XmlArray("ListOfLinks"),XmlArrayItem("Link",Type = typeof(Link))] public List Links { get;set; } } [Serializable] [XmlRoot("Link")] public class Link { [XmlElement("Uri")] public Uri Uri { get; set; } [XmlElement("Status")] public string Status { get; set; } }
获取以下错误:有一个错误反映了类型'System.Collections.Generic.List`1 [DownloadTRON.Entities.Batche]'.
自从过去4个小时以来一直在尝试这个,任何身体都可以指出我做错了什么!
关心普拉文