I have the following attached class. When I use the following code in a form:It throws an InvalidOperationException and says: "There was an error reflecting type 'XmlList' " on the highlighted line above.Code:XmlList myList = new XmlList(); myList.AddItem(new List("test1","test2")); myList.AddItem(new List("test3","test4")); myList.AddItem(new List("test5","test6")); XmlSerializer s = new XmlSerializer( (typeof(XmlList)) ); TextWriter w = new StreamWriter( "list.xml" ); s.Serialize( w, myList ); w.Close(); XmlList newList; TextReader r = new StreamReader( "list.xml" ); newList = (XmlList)s.Deserialize( r ); r.Close();
Any ideas?![]()




Reply With Quote