我遇到一个问题,每次我第一次运行应用程序时都会收到 IsolatedStorageException(“IsolatedFileStorageStream 上不允许的操作”)。随后运行该应用程序时,它工作得很好。我已经尝试了所有我能找到的打开文件进行写入的方法,包括
using (var iso = IsolatedStorageFile.GetUserStoreForApplication())
using (IsolatedStorageFileStream file = new IsolatedStorageFileStream(fileName, FileMode.Create, FileAccess.Write, iso))
{
}
using(var iso = IsolatedStorageFile.GetUserStoreForApplication())
using(IsolatedStorageFileStream file = iso.OpenFile(fileName, FileMode.OpenOrCreate))
{
}
以及这些方法的其他各种重载。我所做的一切都没有奏效,我已经按照 Stack Overflow 中所有其他帖子和我能找到的每篇博文中的步骤进行操作。当我查看输出时,每次都会抛出以下异常:
A first chance exception of type 'System.IO.FileNotFoundException' occurred in mscorlib.dll
A first chance exception of type 'System.Net.WebException' occurred in System.Windows.dll
A first chance exception of type 'System.Net.WebException' occurred in System.Windows.dll
A first chance exception of type 'System.IO.DirectoryNotFoundException' occurred in mscorlib.dll
A first chance exception of type 'System.IO.IsolatedStorage.IsolatedStorageException' occurred in mscorlib.dll
有没有人对它爆炸的原因有任何其他想法?我正在使用 WP7 7.1 RTM 工具。
最佳答案
关于c# - 第一次访问缓存时出现 IsolatedStorage 异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7640804/