简体   繁体   English

IsolatedStorageFile异常

[英]IsolatedStorageFile exception

I try to create IsolatedStorageFile with the following code: 我尝试使用以下代码创建IsolatedStorageFile

IsolatedStorageFile isf = IsolatedStorageFile.GetUserStoreForApplication();

but I get the following exception: 但我得到以下异常:

IsolatedStoredException 
"Unable to determine application identity of the caller."

What could be the possible reason of this? 可能的原因是什么?

If you're seeing this while debugging, you can resolve it by enabling ClickOnce security settings by going to the Security tab in your project's properties. 如果您在调试时看到此信息,可以通过转到项目属性中的“ 安全”选项卡启用ClickOnce安全设置来解决此问题。 This will simulate the manifest required to have an application identity while debugging. 这将模拟在调试时拥有应用程序标识所需的清单。

Note that there is an apparent bug in Visual Studio (at least 2012 Update 4) where even after enabling the security settings it still throws this error. 请注意,Visual Studio(至少2012 Update 4)中存在明显的错误,即使在启用安全设置后,它仍然会抛出此错误。 If this happens, close the project and delete the .csproj.user file and then reopen the project. 如果发生这种情况,请关闭项目并删除.csproj.user文件,然后重新打开该项目。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM