Background task and write to isolated storage

I try my best to write to isolated storage in my background task. The reason for this is that at every start of the background task I load data, and I need to compare this data the next time the background task starts. If the data has been changed, a toast notification is displayed.

The problem is that the data that I write to isolated storage is not saved. I can use it in the rest of the OnInvoke function, but the next time the background task starts, there will be no value.

Am I missing something, I thought it would be easy?

EDIT: Reading values โ€‹โ€‹works very well, and writing values โ€‹โ€‹from my main application also works fine. The code I use in my OnInvoke function is this:

IsolatedStorageSettings settings = IsolatedStorageSettings.ApplicationSettings; settings["WebValue"] = gtResult[i]; 
+4
source share
1 answer

Maybe settings.Save(); should do it?

+7
source

Source: https://habr.com/ru/post/1382161/


All Articles