I have a class which stores some music information for an app. Every time I exit the app
""Type 'Nokia.Music.ListResponse`1[Nokia.Music.Types.Product]' cannot be serialized. Consider marking it with the DataContractAttribute attribute, and marking all of its members you want serialized with the DataMemberAttribute attribute. Alternatively, you can ensure that the type is public and has a parameterless constructor - all public members of the type will then be serialized, and no attributes will be required."
Looking at the stack trace I think the tombstoning process is killing it by trying to save the game state:
at Microsoft.Phone.Shell.BaseStreamPersister.Serialize(IDictionary`2 dictionary, IEnumerable`1 knownTypes)
at Microsoft.Phone.Shell.PhoneApplicationService.FireDeactivated(UInt32 reason)
at Microsoft.Phone.TaskModel.Interop.ITask.Pause.Invoke(UInt32 reason)
at Microsoft.Phone.TaskModel.Interop.Task.FireOnPause(UInt32 reason)
I only keep hold of a ListResponse<Product> in one place in my code. I've marked that class with a [DataContract] attribute and all properties with a [Datamember] attribute, but the exception still gets fired. The class is already public and has a parameterless constructor/
Any ideas on what is happening and how I can fix it?