I have the following weird behavior in my Windows 8 phone, C #.
I save the setting with:
private void SaveProperty<T>(T property, string propertyName) { if (IsolatedStorageSettings.ApplicationSettings.Contains(propertyName)) IsolatedStorageSettings.ApplicationSettings[propertyName] = property; else IsolatedStorageSettings.ApplicationSettings.Add(propertyName, property); IsolatedStorageSettings.ApplicationSettings.Save(); }
When the application starts, I can read all the settings saved in IsolatedStorageSettings.ApplicationSettings .
But when I open the application again (open it from the list of applications), IsolatedStorageSettings.ApplicationSettings -Dictionary contains the keys and values โโof Zero ( 0 ).
Did I miss something?
I used ISETool.exe to take snapshots of the isolated storage of my application (thanks to chepene). I saw this behavior: when I wrote Settings (this means that after the SaveProperty<T>() function has completed) and the application is still working, I have Settings saved in _ApplicationSettings . This is consistent with my observation, which I can read from IsolatedStorageSettings.ApplicationSettings when the application is running. The _ApplicationSettings file also exists if it is in a tombstone or does not work (when I can access it by holding the phoneโs back button and when the application is closed using the back button).
But when the application opens again (through the list of applications), the _ApplicationSettings file disappeared ...
I also see that when I write a file in IsolatedStorage with:
SharedStorageAccessManager.CopySharedFileAsync( Windows.Storage.ApplicationData.Current.LocalFolder, fileName+"orig", Windows.Storage.NameCollisionOption.ReplaceExisting, fileID);
and when I donโt read this file, it will disappear the next time I open the application.
By the way, to avoid confusion: I do not reinstall the application every time I open it.
If you need more information, please ask.
Any help was appreciated.