Exhaustive storage errors

I am building a Windows Phone 7 application using isolated storage. The code works most of the time, but I constantly get IsolStorageExceptions:

{"An error occurred while accessing IsolatedStorage."} There are no further details about the reason for the exception. Here is the stack trace: at System.IO.IsolatedStorage.IsolatedStorageFile.DeleteFile(String file) at MyApp.Core.Data.WindowsPhoneFileRepository.DeleteFile(String name) at MyApp.Core.Domain.ThingService.SaveThing(Thing Thing) at MyApp.Core.Domain.TrackedThingService.PersistThingLocally(TrackedThing Thing) at MyApp.Ui.ViewModels.TrackViewModel.<.ctor>b__3(Thing Thing) at GalaSoft.MvvmLight.Command.RelayCommand`1.Execute(Object parameter) at GalaSoft.MvvmLight.Command.EventToCommand.Invoke(Object parameter) at System.Windows.Interactivity.TriggerAction.CallInvoke(Object parameter) at System.Windows.Interactivity.TriggerBase.InvokeActions(Object parameter) at System.Windows.Interactivity.EventTriggerBase.OnEvent(EventArgs eventArgs) at System.Windows.Interactivity.EventTriggerBase.OnEventImpl(Object sender, EventArgs eventArgs) at System.Windows.Controls.Primitives.ButtonBase.OnClick() at System.Windows.Controls.Button.OnClick() at System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e) at System.Windows.Controls.Control.OnMouseLeftButtonUp(Control ctrl, EventArgs e) at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, String eventName) 

The file exists. I put all my isolation resources inside using blocks, so I should not open the file anywhere.

What could be the reason for this?

How can I get more details about the reason for the exception?

+7
windows-phone-7 silverlight isolatedstorage
source share
4 answers

Using blocks is currently not guaranteed to hide / close threads in WP7.

Close all files / streams explicitly until the SDK reaches a point that you can really trust! :)

+7
source share

I would specifically specify to make sure that you have closed all readers and writers with something in the file you are trying to delete. I am not saying that this will definitely fix, but rather, it will not be possible to delete files that exist, usually caused by open files.

+2
source share

Keep in mind that WP7 is still in beta (have you upgraded from CTP to Beta?).

Consider creating a very simple application that manipulates isolated storage in the way that your main application should see if you can create a small repo of the problem. Having done this, send it to Microsoft so that they can take a look at it.

0
source share

I had the same problem.

I checked carefully and found a place where I did not close FileStream. Closing this solution to the problem for me.

0
source share

All Articles