locked
WinRT information: Error trying to write application data container value RRS feed

  • Question

  • Hi,

    I am getting following exception on

    ApplicationData.Current.LocalSettings.Values["someke"] = JsonConvert.SerializeObject("list of objects") ;

    An exception of type 'System.Exception' occurred in mscorlib.dll but was not handled in user code

    WinRT information: Error trying to write application data container value

    Additional information: The size of the state manager setting value has exceeded the limit.

    Error trying to write application data container value

    If there is a handler for this exception, the program may be safely continued.

    Plz help if any one can and I will be great thankful to you.

    Tuesday, November 26, 2013 4:08 PM

Answers

  • If the object is to large to store in local settings you will need to save the string to a text file in isolated storage
    • Marked as answer by Anne Jing Tuesday, December 3, 2013 6:08 AM
    Tuesday, November 26, 2013 6:13 PM
  • The setting values are allowed to be of few KBs only (I don't remember the limit). You will have to use 1 of the following folder to store the serialized data as file:

    ApplicationData.Current.LocalFolder

    or

    ApplicationData.Current.RoamingFolder

    Also, although it's not very clear from the code, I take the risk of saying that "someke" doesn't seem to be representing any kind of user settings.

    • Marked as answer by Anne Jing Tuesday, December 3, 2013 6:08 AM
    Wednesday, November 27, 2013 7:07 AM
  • Hi ,

    There's a limit when writing to the localsettings. If I remember correctly you can increase this size but do not expect too much.

    I would suggest to write them to a file or use sqlite to store your data.

    You can always create a folder of your own , add it to your FutureAccesslist and store in there in a file whatever you want.

    Otherwise if you want to make it more structured and correct you can use sqlite.

    Take a look at here

    http://code.msdn.microsoft.com/windowsapps/Sqlite-For-Windows-8-Metro-2ec7a882

    or here

    http://wp.qmatteoq.com/using-sqlite-in-your-windows-8-metro-style-applications/

    thank you


    • Edited by zakkar Wednesday, November 27, 2013 12:13 PM
    • Marked as answer by Anne Jing Tuesday, December 3, 2013 6:08 AM
    Wednesday, November 27, 2013 12:12 PM

All replies

  • If the object is to large to store in local settings you will need to save the string to a text file in isolated storage
    • Marked as answer by Anne Jing Tuesday, December 3, 2013 6:08 AM
    Tuesday, November 26, 2013 6:13 PM
  • The setting values are allowed to be of few KBs only (I don't remember the limit). You will have to use 1 of the following folder to store the serialized data as file:

    ApplicationData.Current.LocalFolder

    or

    ApplicationData.Current.RoamingFolder

    Also, although it's not very clear from the code, I take the risk of saying that "someke" doesn't seem to be representing any kind of user settings.

    • Marked as answer by Anne Jing Tuesday, December 3, 2013 6:08 AM
    Wednesday, November 27, 2013 7:07 AM
  • Hi ,

    There's a limit when writing to the localsettings. If I remember correctly you can increase this size but do not expect too much.

    I would suggest to write them to a file or use sqlite to store your data.

    You can always create a folder of your own , add it to your FutureAccesslist and store in there in a file whatever you want.

    Otherwise if you want to make it more structured and correct you can use sqlite.

    Take a look at here

    http://code.msdn.microsoft.com/windowsapps/Sqlite-For-Windows-8-Metro-2ec7a882

    or here

    http://wp.qmatteoq.com/using-sqlite-in-your-windows-8-metro-style-applications/

    thank you


    • Edited by zakkar Wednesday, November 27, 2013 12:13 PM
    • Marked as answer by Anne Jing Tuesday, December 3, 2013 6:08 AM
    Wednesday, November 27, 2013 12:12 PM