您的位置:首页 > 移动开发

IsolatedStoreExceptio:Unable to determine application identity of the caller

2011-08-02 21:32 585 查看
在winform或者控制台程序中使用下面代码时,会抛出IsolatedStoreExceptio:Unable to determine application identity of the caller

using (var isolatedFile = IsolatedStorageFile.GetMachineStoreForApplication())
{

}

using (var isolatedFile = IsolatedStorageFile.GetUserStoreForApplication())
{

}


出现这个异常的原因是机器范围和应用范围内的独立存储只能在ClickOnce程序部署后使用。如果你的程序不是通过ClickOnce部署后执行的你就会看到“Unable to determine the application identity of the caller”.

使用下面代码可以正常执行:

using (var isolatedFile = IsolatedStorageFile.GetUserStoreForAssembly())
{

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐