访问IsolatedStorageBackingStore时出现HRESULT 0X80131468的原因

我面临的情况是我在W2k3服务器上运行的ASP.NET Web服务(.NET 3.5),该服务器使用CacheManager / IsolatedStorage存储来存储持久化状态变量。 在我们更改物理机器之前,此配置已经运行了很长时间。 现在,当访问该值的代码运行时,它会抛出IsolatedStorageException(在下面发布)。 据我所知,用户/程序集存储是正在访问的内容,执行用户是本地管理员组的成员。 有没有人建议缺少什么特权?

错误

无法创建商店目录。 (HRESULTexception:0x80131468)

堆栈跟踪

键入:Microsoft.Practices.ObjectBuilder2.BuildFailedException。 错误:当前构建操作(构建密钥构建密钥[Microsoft.Practices.EnterpriseLibrary.Caching.ICacheManager,缓存管理器])失败:无法创建商店目录。 (来自HRESULT的exception:0x80131468)(策略类型为ConfiguredObjectStrategy,索引2)。 跟踪:位于Microsoft.Practices的Microsoft.Practices.ObjectBuilder2.Builder.BuildUp(IReadWriteLocator定位器,ILifetimeContainer生命周期,IPolicyList策略,IStrategyChain策略,Object buildKey,Object existing)上的Microsoft.Practices.ObjectBuilder2.StrategyChain.ExecuteBuildUp(IBuilderContext context)。 ObjectBuilder2.Builder.BuildUp [TTypeToBuild](IReadWriteLocator定位器,ILifetimeContainer生命周期,IPolicyList策略,IStrategyChain策略,Object buildKey,Object existing),位于Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ObjectBuilder.EnterpriseLibraryFactory.BuildUp [T](IReadWriteLocator定位器, ILifetimeContainer lifetimeContainer,IConfigurationSource configurationSource)at Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ObjectBuilder.LocatorNameTypeFactoryBase 1.CreateDefault() at Microsoft.Practices.EnterpriseLibrary.Caching.CacheFactory.GetCacheManager() at Ept.Commands.SettlementCommand.BeginSettlement() in c:\Projects\EPT\Ept.Framework.Services\Commands\SettlementCommand.cs:line 102 at Ept.Commands.SettlementCommand.ExecuteKernel(SettlementRequest request) in c:\Projects\EPT\Ept.Framework.Services\Commands\SettlementCommand.cs:line 188 at Ept.Command 1.CreateDefault() at Microsoft.Practices.EnterpriseLibrary.Caching.CacheFactory.GetCacheManager() at Ept.Commands.SettlementCommand.BeginSettlement() in c:\Projects\EPT\Ept.Framework.Services\Commands\SettlementCommand.cs:line 102 at Ept.Commands.SettlementCommand.ExecuteKernel(SettlementRequest request) in c:\Projects\EPT\Ept.Framework.Services\Commands\SettlementCommand.cs:line 188 at Ept.Command 2.Execute(TRequest请求)在c:\ Projects \ EPT \ Ept.Framework.Services \ Commands \ Command.cs:第79行.ExecutionStrategyTypeName:ConfiguredObjectStrategy ExecutingStrategyIndex:2 BuildKey:Build Key [Microsoft.Practices.EnterpriseLibrary.Caching.ICacheManager ,缓存管理器]类型:System.IO.IsolatedStorage.IsolatedStorageException。 错误:无法创建商店目录。 (来自HRESULT的exception:0x80131468)。 跟踪:位于System.IO.IsolatedStorage上的System.IO.IsolatedStorageStorageSilerageFile.GetRootDir(隔离存储范围)中的System.IO.IsolatedStorage.IsolatedStorageFile.nGetRootDir(IsolatedStorageScope范围)处于System.IO.IsolatedStorage上的System.IO.IsolatedStorage.IsolatedStorageFile.GetRootDir(IsolatedStorageScope范围)处。 System.IO.IsolatedStorage.IsolatedStorageFile.Init(IsolatedStorageScope范围)中的System.IO.IsolatedStorage.IsolatedStorageFile.GetStore(IsolatedStorageScope范围,类型domainEvidenceType,类型assemblyEvidenceType)上的.isolatedStorageFile.GetGlobalFileIOPerm(IsolatedStorageScope范围),位于Microsoft.Practices.EnterpriseLibrary.Caching .BackingStoreImplementations.IsolatedStorageBackingStore.Initialize()在Microsoft.Practices.EnterpriseLibrary.Caching.Configuration.IsolatedStorageBackingStoreAssemb的Microsoft.Practices.EnterpriseLibrary.Caching.BackingStoreImplementations.IsolatedStorageBackingStore..ctor(String storageAreaName,IStorageEncryptionProvider encryptionProvider)。 ler.Assemble(IBuilderContext context,CacheStorageData objectConfiguration,IConfigurationSource configurationSource,ConfigurationReflectionCache reflectionCache)at Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ObjectBuilder.AssemblerBasedObjectFactory 2.Create(IBuilderContext context, TConfiguration objectConfiguration, IConfigurationSource configurationSource, ConfigurationReflectionCache reflectionCache) at Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ObjectBuilder.AssemblerBasedCustomFactory .EnterpriseLibrary.Common.Configuration.ObjectBuilder.AssemblerBasedCustomFactory 2.Create(IBuilderContext context,String name,IConfigurationSource configurationSource,ConfigurationReflectionCache reflectionCache)at Microsoft.Practices.EnterpriseLibrary.Caching.Configuration.CacheManagerAssembler.Assemble(IBuilderContext context,CacheManagerDataBase objectConfiguration,IConfigurationSource configurationSource, ConfigurationReflectionCache reflectionCache)在Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ObjectBuilder.AssemblerB asedObjectFactory 2.Create(IBuilderContext context, TConfiguration objectConfiguration, IConfigurationSource configurationSource, ConfigurationReflectionCache reflectionCache) at Microsoft.Practices.EnterpriseLibrary.Caching.CacheManagerCustomFactory.Create(IBuilderContext context, CacheManagerDataBase objectConfiguration, IConfigurationSource configurationSource, ConfigurationReflectionCache reflectionCache) at Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ObjectBuilder.AssemblerBasedCustomFactory .Configuration.ObjectBuilder.AssemblerBasedCustomFactory 2.Create(IBuilderContext context,String name,IConfigurationSource configurationSource,ConfigurationReflectionCache reflectionCache)at Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ObjectBuilder.AssemblerBasedCustomFactory`2.CreateObject(IBuilderContext context,String name,IConfigurationSource configurationSource, ConfigurationReflectionCache reflectionCache)在Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ObjectBuilder.ConfiguredObjectStrategy.Pr Microsoft.Practices.ObjectBuilder2.StrategyChain.ExecuteBuildUp(IBuilderContext context)中的eBuildUp(IBuilderContext上下文)。

问题的根本原因是运行Web服务的帐户没有创建本地用户配置文件,因此用户程序集存储不存在。 简单的修复只是登录到服务帐户的框。

如果您使用的是Windows 2012 R2和IIS 8.5 ,如果您的应用程序以其自己的标识特定的应用程序池上运行,则需要检查“ 池高级参数 ”中的“ 加载用户配置文件 ”选项是否设置为True 。 通过这样做,Windows将在C:\ Users下创建一个具有应用程序池标识名称的文件夹,并允许您的应用程序在本地存储中写入。

我有这个问题,但创建“C:\ Documents and Settings \ Default User \ Local Settings \ Application Data \ IsolatedStorage”并没有解决问题,因为在某些时候有一个配置文件名称更改。 该服务器的实际位置是“C:\ Documents and Settings \ Default User.WINDOWS \ Local Settings \ Application Data \ IsolatedStorage”。

如果这不起作用,我使用Process Monitor和“IsolatedStorage”filter来查找拒绝访问错误的正确路径。

Windows 10上, IIS应用程序池设置“加载用户配置文件”默认为True 。 但在Windows 2012上假的 。 切换到True解决了我的问题。