Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Isolated storage is always empty on emulator?

in my WP7 application, I'm doing :

string userName = IsolatedStorageSettings.ApplicationSettings.Contains("UserName") ? IsolatedStorageSettings.ApplicationSettings["UserName"].ToString() : null;
if (string.IsNullOrEmpty(userName))
    IsolatedStorageSettings.ApplicationSettings["UserName"] = "test";

I launch my app (F5), off course, the userName is empty, so it's stored in isolated storage.

I stop my app (stop debugging), and I don't close emulator

Launch again my app (F5), but still empty .

I've read that the isolated storage should persist while the emulator isn't closed.

What am I doing wrong ?

Thanks in advance for your answer.

like image 995
Tim Avatar asked Dec 28 '22 06:12

Tim


1 Answers

You need to also call

IsolatedStorageSettings.ApplicationSettings.Save();

after you've changed the settings.

like image 165
Damian Avatar answered Jan 02 '23 19:01

Damian