|
-
August 9th, 2011, 02:25 AM
#1
XML error
Need help here. Trying to use serialization to save my array of monsters but got this error.
An unhandled exception of type 'System.InvalidOperationException' occurred in System.Xml.dll
Additional information: There was an error generating the XML document.
Here's my code:
public void Save()
{
using (IsolatedStorageFile saveGameFile = IsolatedStorageFile.GetUserStoreForApplication())
using (IsolatedStorageFileStream SaveGameStream = new IsolatedStorageFileStream("monster.dat", FileMode.OpenOrCreate, saveGameFile))
{
XmlSerializer serializer = new XmlSerializer(typeof(List<Monster>));
serializer.Serialize(SaveGameStream, _lMonster); <------ error on this line
}
}
-
August 15th, 2011, 05:03 PM
#2
Re: XML error
Is _IMonster the same type as typeof(List<Monster>)?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|