我尝试使用以下代码创建 IsolatedStorageFile
:
IsolatedStorageFile isf = IsolatedStorageFile.GetUserStoreForApplication();
但我得到以下异常:
IsolatedStoredException
"Unable to determine application identity of the caller."
这可能是什么原因?
最佳答案
如果您在调试时看到此问题,可以通过转到项目属性中的安全 选项卡启用ClickOnce 安全设置 来解决它。这将模拟在调试时拥有应用程序身份所需的 list 。
请注意,Visual Studio(至少 2012 Update 4)中存在一个明显的错误,即使在启用安全设置后它仍然会抛出此错误。如果发生这种情况,请关闭项目并删除 .csproj.user 文件,然后重新打开项目。
关于c# - IsolatedStorageFile 异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5284622/