Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Jan 2014

    Question Type 'Nokia.Music.ListResponse`1[Nokia.Music.Types.Product]' cannot be serialized

    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.SaveState()
    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?


  2. #2
    Nokia Developer Expert
    Join Date
    Feb 2014

    Re: Type 'Nokia.Music.ListResponse`1[Nokia.Music.Types.Product]' cannot be serialized

    Hi, you're right, our objects are not marked as serializable. Which method(s) are you calling to get the product data in the first place? Our SDK handles caching of data pretty well, so that if you called the same method twice the cache is used, meaning you wouldn't need to serialize the data. Does that help?

Similar Threads

  1. Nokia Music Api Product Release Dates
    By bswan in forum Nokia MixRadio Windows Phone API
    Replies: 2
    Last Post: 2013-04-30, 09:02
  2. nokia music not available in this locale? (Music Explorer Sample)
    By roschler in forum Windows Phone General
    Replies: 5
    Last Post: 2013-04-02, 14:39
  3. N79 Music Player is not deducting songs in music folder
    By vijayan.vvv in forum General Development Questions
    Replies: 1
    Last Post: 2009-09-11, 13:38
  4. Capturing Music Slider Event ( Nokia 5610 Express Music )
    By mekadur in forum Mobile Java General
    Replies: 2
    Last Post: 2008-01-24, 07:57

Posting Permissions

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