【发布时间】:2009-06-23 22:24:12
【问题描述】:
您好,我必须在隔离空间中存储一些隐藏信息。为此,我使用 System.IO.Isolated 类,如
IsolatedStorageFile isf = System.IO.IsolatedStorage.IsolatedStorageFile.GetStore(IsolatedStorageScope.User | IsolatedStorageScope.Assembly, null, null);
Stream writer = new IsolatedStorageFileStream(filename, FileMode.Create, isf);
IFormatter formatter = new BinaryFormatter();
formatter.Serialize(writer, appCollection.ToString());
writer.Close();
它在 Windows XP 中运行良好,但在 Windows 2003 的生产服务器上却显示异常
System.IO.IsolatedStorage.IsolatedStorageException:无法创建存储目录。
我在我的 asp.net 项目文件夹中拥有所有人完全控制权限。注意CSoft.Core是我自己创建的个人Framework。
这是我的堆栈跟踪:
[IsolatedStorageException:无法创建存储目录。 (来自 HRESULT 的异常:0x80131468)]
System.IO.IsolatedStorage.IsolatedStorageFile.nGetRootDir(IsolatedStorageScope 范围)+0
System.IO.IsolatedStorage.IsolatedStorageFile.InitGlobalsNonRoamingUser(IsolatedStorageScope 范围)+97
System.IO.IsolatedStorage.IsolatedStorageFile.GetRootDir(IsolatedStorageScope 范围)+137
System.IO.IsolatedStorage.IsolatedStorageFile.GetGlobalFileIOPerm(IsolatedStorageScope 范围)+213
System.IO.IsolatedStorage.IsolatedStorageFile.Init(IsolatedStorageScope 范围)+56
System.IO.IsolatedStorage.IsolatedStorageFile.GetStore(IsolatedStorageScope 范围,类型 domainEvidenceType,类型 assemblyEvidenceType) +59
CSoft.Core.IO.StorageHelper.Save(字符串文件名,字符串内容)在 c:\Projectos\FrameworkCS\CSoft.Core\IO\StorageHelper.cs:18
CSoft.Web.UI.ViewStateHelper.SerializeViewState(HttpContext 上下文, 对象状态)在 c:\Projectos\FrameworkCS\CSoft.Web.Controls\Web\UI\ViewStateHelper.cs:65 CSoft.Web.UI.Page.SavePageStateToPersistenceMedium(对象状态)在 c:\Projectos\FrameworkCS\CSoft.Web.Controls\Web\UI\Page.cs:302
System.Web.UI.Page.SaveAllState() +236
System.Web.UI.Page.ProcessRequestMain(布尔值 includeStagesBeforeAsyncPoint,布尔型 includeStagesAfterAsyncPoint) +1099
【问题讨论】:
-
请发布完整的异常,包括所有 InnerException。捕获异常,然后发布 ex.ToString() 的结果。
标签: c# asp.net visual-studio isolatedstorage