Results 1 to 7 of 7

Thread: [RESOLVED] Serialized XML Classes - InvalidOperationException

Threaded View

  1. #1

    Thread Starter
    Frenzied Member TomGibbons's Avatar
    Join Date
    Feb 2002
    Location
    San Diego, CA Previous Location: UK
    Posts
    1,345

    Resolved [RESOLVED] Serialized XML Classes - InvalidOperationException

    I have the following attached class. When I use the following code in a form:
    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();
    It throws an InvalidOperationException and says: "There was an error reflecting type 'XmlList' " on the highlighted line above.

    Any ideas?
    Attached Files Attached Files
    Last edited by TomGibbons; Mar 31st, 2005 at 12:49 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width