Possible Duplicate:
Serializing an array of integers using XmlSerializer
I am writing my Windows 8 app in C# and upon trying to serialize my custom object I ran into an “There was an error reflecting type” error message. Upon looking into the inner exception I came across the fact that we can’t serialize multidimensional arrays.
Am I doing something wrong or am I right?
If I’m right, is there a way to pack up my class of ints and int[,] arrays to send them to romaing storage? Thank you.
I’m using this .dll:
http://winrtstoragehelper.codeplex.com/
Here is my code:
var objectStorageHelper = new ObjectStorageHelper<BaseballTeam>(StorageType.Roaming);
await objectStorageHelper.SaveAsync(team);
With BaseballTeam being the type, and team the specific object.
Not using that library; it uses the
XmlSerializer, which does not support multidimensional arrays (See source at http://winrtstoragehelper.codeplex.com/SourceControl/changeset/view/60a57faeb36a#WinRtUtility%2fWinRtUtility%2fObjectStorageHelper.cs). You can still use some other serializer (IIRC JSON.NET supports multidimensional arrays, for example), and just write the serialized object to the roaming storage using the File API.Or choose another library which does that for you.