views:

53

answers:

2

I’m storing user state in an xml file in IsolatedStorage. When I run my app in the emulator I notice that these files often disappear. Everything works fine when the app is running – it seems to be when the app restarts (it happens when if keep the emulator open or not).

Is Windows deleting my files in IsolatedStorage to save space? Should expect this behavior on the actual device or is this just an emulator bug?

Thanks,

+3  A: 

Isolated Storage being deleted is normal, if you close the emulator completely. If it's being deleted on start (without the emulator closing), it sounds like your code is causing the file to either be deleted or overwritten. Could you post your code of any IsolatedStorage activity during the startup of your application?

keyboardP
OK interesting. My app doesn't call any deletes so not sure how useful my code would be. So are you saying that it is expected that files are deleted when the emulator restarts? I'm assuming that this wil NOT be the case for a real device right?
will
just the emulator. the real phone will not wipe isolated storage on restarts.
John Gardner
Awesome, thanks. Glad I double checked...
will
A: 

Isolated Storage will also be wiped if you do a rebuild of your solution in Visual Studio. Rebuild triggers reinstall and install which wipes on the app's isolated storage.

vamana