I’ve got a Windows Phone 7 Silverlight app that I am trying to use Isolated Storage on the emulator, to no avail. I’ve got several files added to the project as Content, I’ve deployed the app to the emulator before launching the debugger, I use the back button to “close” the debugging session, and I do not close the emulator between runs. And every single time, I have empty isolated storage. What am I doing wrong? I use this, comes up blank every time.
private void CheckIsolatedStorageForContent()
{
using ( var isf = IsolatedStorageFile.GetUserStoreForApplication() )
{
foreach ( var fileName in isf.GetFileNames() )
{
listBox.Items.Add( fileName );
}
}
}
Just putting them in your XAP as content won’t deploy them to Isolated Storage.
On the first execution of your app, you’ll need to copy the files to the Isolated Storage. If they’re static, there’s really no need to do this, as you can just access them as content. If you need to update them, then you will need to get them to the IsoStore.