【发布时间】:2018-07-30 11:28:23
【问题描述】:
我决定对临时文件使用隔离存储:
using (IsolatedStorageFile isoStore = IsolatedStorageFile.GetUserStoreForDomain())
{
using (IsolatedStorageFileStream userStream = new IsolatedStorageFileStream("UserSettings.set", FileMode.Create, isoStore))
{
}
}
我从在这台计算机上运行的示例中获取了这段代码。仅包含此代码的最小项目也成功运行。
但在我当前的项目中执行IsolatedStorageFileStream 构造函数时,会出现以下消息:
MyApp.exe - 断言失败
表达式:[mscorlib 递归资源查找错误]
描述:在 mscorlib 中查找资源期间无限递归。 这可能是 mscorlib 中的错误,或者可能是某些可扩展性中的错误 诸如程序集解析事件或 CultureInfo 名称之类的点。
资源名称:Seurity_Generic
在这条消息中,我可以看到相当大的堆栈跟踪(它以调用IsolatedStorageFileStream 构造函数开始):
我也无法从这段代码中捕获异常。
System.Environment.ResourceHelper.GetResourceStringCode() 中似乎发生了错误。
这可能是什么原因?我找不到有关此主题的任何内容。
删除C:\Users\user\AppData\Local\IsolatedStorage 文件夹并不能解决问题(我确定只有我的文件夹)。
【问题讨论】:
标签: c# windows-7 isolatedstoragefile