Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/visual-studio-code/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Silverlight IsolatedStorageFile使用引发放弃的MutexException_Silverlight_Isolatedstorage - Fatal编程技术网

Silverlight IsolatedStorageFile使用引发放弃的MutexException

Silverlight IsolatedStorageFile使用引发放弃的MutexException,silverlight,isolatedstorage,Silverlight,Isolatedstorage,我正在用Silverlight 4.0中的一个方法维护一些代码,该方法 IsolatedStorageException没有足够的可用空间来执行该操作 ,直到我在我的C:\Documents and Settings\(user)\Local Settings\Application Data目录中为其创建了目录。现在我有点烦了 系统。发生异常 Message=由于放弃互斥锁,等待已完成。 堆栈跟踪: 在System.Threading.WaitHandle.InternalWaitOne(安全

我正在用Silverlight 4.0中的一个方法维护一些代码,该方法

IsolatedStorageException没有足够的可用空间来执行该操作

,直到我在我的C:\Documents and Settings\(user)\Local Settings\Application Data目录中为其创建了目录。现在我有点烦了

系统。发生异常 Message=由于放弃互斥锁,等待已完成。 堆栈跟踪: 在System.Threading.WaitHandle.InternalWaitOne(安全句柄WaitableSaffeHandle,Int64毫秒计时,布尔HastThreadAffinity,布尔exitContext) InnerException:null

下面的代码在调用IsolatedStorageFile.GetUserStoreForApplication()时引发此异常


这段代码以前没有给我带来任何问题。有人看到它有什么可怕的错误吗?

删除了我的答案,因为清楚地纠正错误并不重要。在对答案的评论中回答你的问题:背带是一种托住裤子的装置,这是伦敦银行家的惯常穿着。由于某些原因,目前还不是很受欢迎。。。。。我指的是牙套而不是银行家,当然。不得不向我解释一个双关语是令人尴尬的:)银行家现在在这里不那么流行。也许你应该纠正你代码中的拼写错误,这样其他人就不会提供与我刚才删除的答案相同的答案。有时当我用Visual Studio 2010重新调试SL5 Sketchflow应用程序时,我也会遇到同样的异常。但是我的代码对隔离存储没有任何作用。它是发生在所有机器上,还是只发生在一台机器上?
public object Getfromcache()
    {

        try
        {
            using (IsolatedStorageFile file = IsolatedStorageFile.GetUserStoreForApplication())
            using (IsolatedStorageFileStream stream = new IsolatedStorageFileStream("AppCache/" + cachekey, FileMode.Open, file))

                if (stream.Length > 0)
                {
                    return serializer.ReadObject(stream);
                }
                else
                {
                    return null;
                }
        }
        catch
        {
            return null;
        }
    }