Suspending PRISM based MVVM Windows Store app


  • Hello,

    When I suspend my app in debugging mode I get a "Session state service failed" with an inner exception "The type MyHubViewModel" cannot be serialized. Consider marking it with the DataContractAttribute attribute, and marking all of its members you want serialized with the DataMemberAttribute attribute.  If the type is a collection, consider marking it with the CollectionDataContractAttribute.  See the Microsoft .NET Framework documentation for other supported types.".

    I tried marking the class with [DataContract] but I receive the same error. Is there a problem with serializing ViewModels? Or how should this be done? I want to add also that the hub class ViewModel has also other viewmodels members, but since I did not marked them as DataMemberAttributes (yet), I think I should not receive an error, it should not try to serialize them.


    Monday, February 17, 2014 10:17 AM