Store data in Windows Store app

Viewed 6348

Short version: How would you store "large" data in a Windows Store app, using C#?

Long version: I have a json string that I could either store as string (around 65 KB) or - when serialized - as object. I originally thought that I could use something like this:

    public static void SaveData(string param, object value)
    {
        Windows.Storage.ApplicationDataContainer settings = Windows.Storage.ApplicationData.Current.LocalSettings;       
        Windows.Storage.ApplicationDataCompositeValue composite = new Windows.Storage.ApplicationDataCompositeValue();
        composite[param] = value;
        settings.Values[param] = composite;
    }

I tried that, but my app shows the following error:

WinRT information: Error trying to write setting in application data composite value

The error is not really helping me, it simply does not want to save my data. I have just read online that there is only a ridiculous small amount of Bytes allowed to store in the local settings in a Windows Store app using C#.

Is there a fast, safe and elegant way to store my string/object otherwise? Do I really need to write it into a file by myself? Using SQLLite would also be way too much for just this string.

4 Answers
Related