4

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

错误

无法创建存储目录。(来自 HRESULT 的异常:0x80131468)

堆栈跟踪

类型:Microsoft.Practices.ObjectBuilder2.BuildFailedException。错误:当前构建操作(构建密钥 Build Key[Microsoft.Practices.EnterpriseLibrary.Caching.ICacheManager, Cache Manager])失败:无法创建存储目录。(HRESULT 异常:0x80131468)(策略类型 ConfiguredObjectStrategy,索引 2)。跟踪:在 Microsoft.Practices.ObjectBuilder2.Builder.BuildUp(IReadWriteLocator 定位器,ILifetimeContainer 生命周期,IPolicyList 策略,IStrategyChain 策略,对象 buildKey,现有对象)在 Microsoft.Practices 的 Microsoft.Practices.ObjectBuilder2.StrategyChain.ExecuteBuildUp(IBuilderContext context)。微软的 ObjectBuilder2.Builder.BuildUp[TTypeToBuild](IReadWriteLocator 定位器、ILifetimeContainer 生命周期、IPolicyList 策略、IStrategyChain 策略、Object buildKey、Object existing)。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.Command2.在 c:\Projects\EPT\Ept.Framework.Services\Commands\Command.cs:line 79 中执行(TRequest 请求)。ExecutingStrategyTypeName:ConfiguredObjectStrategy ExecutingStrategyIndex:2 BuildKey:Build Key[Microsoft.Practices.EnterpriseLibrary.Caching.ICacheManager , 缓存管理器] 类型:System.IO.IsolatedStorage.IsolatedStorageException。错误:无法创建存储目录。(来自 HRESULT 的异常:0x80131468)。追踪:在 System.IO.IsolatedStorage.IsolatedStorageFile.GetRootDir(IsolatedStorageScope 范围) 在 System.IO.IsolatedStorage.IsolatedStorageFile.InitGlobalsNonRoamingUser(IsolatedStorageScope 范围) 在 System.IO.IsolatedStorage.IsolatedStorageFile.GetRootDir(IsolatedStorageScope 范围) 在 System.IO.IsolatedStorage System.IO.IsolatedStorage 中的 .IsolatedStorageFile.GetGlobalFileIOPerm(IsolatedStorageScope 范围)。2.Create(IBuilderContext context, TConfiguration objectConfiguration, IConfigurationSource configurationSource, ConfigurationReflectionCache reflectionCache) at Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ObjectBuilder.AssemblerBasedCustomFactory2. 在 Microsoft.Practices.EnterpriseLibrary.Caching.Configuration.CacheManagerAssembler.Assemble(IBuilderContext context, CacheManagerDataBase objectConfiguration, IConfigurationSource configurationSource, ConfigurationReflectionCache reflectionCache) 在 Microsoft.Practices.EnterpriseLibrary 中创建(IBuilderContext context, String name, IConfigurationSource configurationSource, ConfigurationReflectionCache reflectionCache)。 Common.Configuration.ObjectBuilder.AssemblerBasedObjectFactory2.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.AssemblerBasedCustomFactory2.在 Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ObjectBuilder.AssemblerBasedCustomFactory 中创建(IBuilderContext 上下文,字符串名称,IConfigurationSource 配置源,ConfigurationReflectionCache 反射缓存)`2.在 Microsoft 中创建对象(IBuilderContext 上下文,字符串名称,IConfigurationSource 配置源,ConfigurationReflectionCache 反射缓存)。 Microsoft.Practices.ObjectBuilder2.StrategyChain.ExecuteBuildUp(IBuilderContext context) 中的 Practices.EnterpriseLibrary.Common.Configuration.ObjectBuilder.ConfiguredObjectStrategy.PreBuildUp(IBuilderContext context)。

4

4 回答 4

7

问题的根本原因是运行 Web 服务的帐户没有创建本地用户配置文件,因此用户程序集存储不存在。简单的解决方法就是使用服务帐户登录该框。

于 2010-07-14T15:12:41.080 回答
2

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

于 2016-02-28T21:38:04.860 回答
1

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

如果这不起作用,我使用带有“IsolatedStorage”过滤器的进程监视器来查找拒绝访问错误的正确路径。

于 2012-06-05T02:05:08.417 回答
0

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

于 2017-10-04T14:28:46.890 回答