首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >IsolatedStorage错误

IsolatedStorage错误
EN

Stack Overflow用户
提问于 2010-07-17 19:51:16
回答 4查看 2.1K关注 0票数 7

我正在构建一个使用独立存储的Windows phone7应用程序。代码大部分时间都能正常工作,但我一直在随机获取IsolatedStorageExceptions:

代码语言:javascript
复制
{"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)

该文件已存在。我将所有IsolatedStorage使用的内容都放在块中,所以我不应该让文件在任何地方打开。

这可能是什么原因造成的?

如何获取有关异常原因的更多详细信息?

EN

回答 4

Stack Overflow用户

发布于 2010-11-12 23:21:06

目前不能保证使用块刷新/关闭WP7中的流。

显式关闭所有文件/流,直到SDK达到您可以真正信任它的程度!:)

票数 7
EN

Stack Overflow用户

发布于 2010-09-27 01:30:13

我会特别检查以确保您已经关闭了文件中您要删除的所有读取器和写入器。我并不是说这一定会解决这个问题,而是不能删除确实存在的文件,这往往是由打开的文件引起的。

票数 2
EN

Stack Overflow用户

发布于 2010-07-18 02:24:20

不应该忽视的是,WP7仍然处于测试版中(您已经从CTP更新到测试版了,对吧?)

考虑创建一个非常简单的应用程序,它以您的主应用程序的方式操作独立存储,看看您是否可以创建一个问题的小Repo。完成后,将其发送给Microsoft,以便他们可以查看它。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/3271353

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档