我正在尝试使用 MVC asp.net 项目让 Appfabric Cache 与 IIS7 一起运行。 在共享目录中使用 XML 配置提供程序。
使用 cassini Web 服务器(我的本地管理员帐户)时,我可以访问 AppFabric 缓存。
使用 IIS(“ApplicationPoolIdentity”)时,我无法使其工作,并且收到标准消息,表明它无法连接到主机。
我尝试向不同用户(APPPOOL\name、NETWORKservice、Everyone 等)授予对缓存的访问权限,但每次都会收到此空异常。
PS C:> Grant-CacheAllowedClientAccount "Everyone"
Grant-CacheAllowedClientAccount : Object reference not set to an instance of an object. At line:1 char:32 + Grant-CacheAllowedClientAccount <<<< Everyone + CategoryInfo : NotSpecified: (:) [Grant-CacheAllowedClientAccou nt], NullReferenceException + FullyQualifiedErrorId :
System.NullReferenceException,Microsoft.Applicat ionServer.Caching.Commands.GrantCacheAllowedClientAccountCommand
我有两台几乎相同的开发机器,使用 win7 x64(域连接),两台计算机上的错误是相同的。
但在我的家庭计算机(未连接域)上,它可以按预期使用相同的安装设置、相同的共享目录。
到目前为止我做了什么:
- 重新安装了两次 appfabric 缓存
- 重新配置缓存以使用另一个目录
- 设置配置目录共享,Everyone完全访问权限
- 目录的安全权限,对每个人都有完全访问权限。
有没有办法更深入地调试此错误消息或修复它的解决方案?
<?xml version="1.0" encoding="utf-8"?> <configuration> <configSections> <section name="dataCache" type="Microsoft.ApplicationServer.Caching.DataCacheSection, Microsoft.ApplicationServer.Caching.Core" /> </configSections> <dataCache size="Small"> <caches> <cache consistency="StrongConsistency" name="default" minSecondaries="0"> <policy> <eviction type="Lru" /> <expiration defaultTTL="10" isExpirable="true" /> </policy> </cache> </caches> <hosts> <host replicationPort="22236" arbitrationPort="22235" clusterPort="22234" hostId="1556989554" size="3003" leadHost="true" account="DOM\vitcpu7$" cacheHostName="AppFabricCachingService" name="vitcpu7.office.domain.se" cachePort="22233" /> </hosts> <deploymentSettings> <deploymentMode value="RoutingClient" /> </deploymentSettings> </dataCache> </configuration>
最佳答案
这是因为它是在域环境中设置的并且“远程注册表”服务未启动。由于我的家庭计算机位于工作组中,不需要“远程注册表”启动其组合,AppFabric 缓存需要此来在 powershell 中进行大部分更改。
关于caching - 访问 AppFabric 缓存时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10010729/