当我试图运行以下代码时,我会得到一个“IsolatedStorageFileStream上不允许的操作”错误:
using (var isf = IsolatedStorageFile.GetUserStoreForApplication())
{
if (!isf.FileExists("Lokacije.abc"))
isf.CreateFile("Lokacije.abc");
using (var stream = new IsolatedStorageFileStream("Lokacije.abc", FileMode.Append, FileAccess.ReadWrite, isf))
{
using (var sw = new StreamWriter(stream))
{
sw.Write(string.Format("GC-X({0})-Y({1})|", x, y));
}
}
}有人知道会是什么吗?我没有在我的应用程序中的任何其他地方使用存储,所以它不可能已经在使用。
发布于 2014-07-05 16:50:07
检查是否有两个线程同时访问IsolatedStorage (即。在VS Debug.View.Threads中,并验证在发生异常时,通过相同的IsoStore代码没有多条路径)。
欲了解更多情况,请参考以下内容:
http://social.msdn.microsoft.com/Forums/wpapps/en-US/a1bb0b15-6bc0-4c63-ac94-ec1e63242cf1/operation-not-permitted-on-isolatedstoragefilestream?forum=wpdevelop
Operation not permitted on IsolatedStorageFileStream error
希望能帮上忙!
https://stackoverflow.com/questions/24585513
复制相似问题