Exceptions:
A first chance exception of type ‘System.IO.FileNotFoundException’ occurred in mscorlib.dll
A first chance exception of type ‘System.IO.IsolatedStorage.IsolatedStorageException’ occurred in mscorlib.dll
public static IsolatedStorageSettings settings = IsolatedStorageSettings.ApplicationSettings;
private void GetScoreData()
{
if (settings.Contains(dataItem2.Name))
{
this.textBlock2.Text = settings[dataItem2.Name].ToString();
}
else
{
settings.Add(dataItem2.Name, "N/A");
this.textBlock2.Text = "N/A";
}
settings.Save();
}
now in the other page
i am updating its value by doing this
ScorePage.settings[“MyKey”] = moves.ToString();
so everytime i restart my emulator and run my project this exception comes.
any reason why?
The isolated storage in the emulator is not persisted after you close it.
Reference: Windows Phone Emulator: (see features)
Isolated storage is available while the emulator is running. Data in isolated storage does not persist after the emulator closes. This includes files stored in a local database, as these files reside in isolated storage.
I suggest you to use site settings over application settings.
One more thing, dont worry the windows phone is persistent.(only the emulator is not!)