gpt4 book ai didi

silverlight - 隔离存储错误

转载 作者:行者123 更新时间:2023-12-04 03:17:54 24 4
gpt4 key购买 nike

我正在构建一个使用独立存储的 Windows Phone 7 应用程序。该代码大部分时间都可以工作,但我不断随机收到IsolatedStorageExceptions:

{"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 使用放在 using blocks 里面,所以我不应该在任何地方打开文件。

什么可能导致这种情况?

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

最佳答案

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

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

关于silverlight - 隔离存储错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3271353/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com