Azure 引用的缓存不存在
历史 在我的开发环境中,运行WindowsAzure Emulator时,我遇到了一个反复出现的错误。在我基于Azure模板创建了一个新的解决方案和项目,并重新安装了2012年10月的更新SDK之前,要解决这个问题。然后我不得不将所有文件复制到新项目中。在经历所有这些之前,因为我知道它可以工作,我想看看是否还有其他我可以做的事情 设置Azure 引用的缓存不存在,azure,Azure,历史 在我的开发环境中,运行WindowsAzure Emulator时,我遇到了一个反复出现的错误。在我基于Azure模板创建了一个新的解决方案和项目,并重新安装了2012年10月的更新SDK之前,要解决这个问题。然后我不得不将所有文件复制到新项目中。在经历所有这些之前,因为我知道它可以工作,我想看看是否还有其他我可以做的事情 设置 视窗8 Visual Studio 2012更新1 IIS Express 8 Windows Azure工具-2012年10月 Windows Azure缓存
- 视窗8
- Visual Studio 2012更新1
- IIS Express 8
- Windows Azure工具-2012年10月
- Windows Azure缓存1.8.1.0
- ASP.NETMVC4.0项目
- Web角色(2个实例)
- 缓存工作角色(2个实例)
- 在缓存工作角色上启用缓存并设置为专用角色(本地角色状态为:UseDevelopmentStorage=true)
- 会话使用分布式缓存
- 输出缓存使用分布式缓存
<sessionState mode="Custom" customProvider="AFCacheSessionStateProvider" cookieName="abc_session">
<providers>
<add name="AFCacheSessionStateProvider" type="Microsoft.Web.DistributedCache.DistributedCacheSessionStateStoreProvider, Microsoft.Web.DistributedCache" cacheName="default" dataCacheClientName="default" applicationName="AFCacheSessionState" />
</providers>
</sessionState>
<outputCache defaultProvider="AFCacheOutputCacheProvider">
<providers>
<add name="AFCacheOutputCacheProvider" type="Microsoft.Web.DistributedCache.DistributedCacheOutputCacheProvider, Microsoft.Web.DistributedCache" cacheName="default" dataCacheClientName="default" applicationName="AFCacheOutputCache" />
</providers>
</outputCache>
</caching>
<dataCacheClients>
<dataCacheClient name="default">
<autoDiscover isEnabled="true" identifier="AppNameCacheWorkerRole" />
</dataCacheClient>
</dataCacheClients>
ErrorCode<ERRCA0009>:SubStatus<ES0001>:Cache referred to does not exist
[DataCacheException: ErrorCode<ERRCA0009>:SubStatus<ES0001>:Cache referred to does not exist. Contact administrator or use the Cache administration tool to create a Cache.]
Microsoft.ApplicationServer.Caching.DataCache.ThrowException(ErrStatus errStatus, Guid trackingId, Exception responseException, Byte[][] payload, EndpointID destination) +767
Microsoft.ApplicationServer.Caching.DataCache.ThrowException(ResponseBody respBody, EndpointID destination) +149
Microsoft.ApplicationServer.Caching.DataCacheFactory.EstablishConnection(IEnumerable`1 servers, RequestBody request, Func`3 sendMessageDelegate, DataCacheReadyRetryPolicy retryPolicy) +967
Microsoft.ApplicationServer.Caching.<>c__DisplayClass4.<Initialize>b__1(RequestBody req) +198
Microsoft.ApplicationServer.Caching.SocketClientProtocol.SendReceive(IVelocityRequestPacket request, Func`2 delegate, EndpointID& destination) +121
Microsoft.ApplicationServer.Caching.SocketClientProtocol.Initialize(IEnumerable`1 servers) +1011
Microsoft.ApplicationServer.Caching.DataCacheFactory.GetCache(String cacheName, CreateNewCacheDelegate cacheCreationDelegate, DataCacheInitializationViaCopyDelegate initializeDelegate) +1103
Microsoft.ApplicationServer.Caching.DataCacheFactory.GetCache(String cacheName) +131
Microsoft.Web.DistributedCache.DataCacheFactoryWrapper.CreateDataCacheFromFactory(DataCacheFactory factory, String cacheName) +63
Microsoft.Web.DistributedCache.CacheHelpers.RunCacheCreationHooks(CacheConnectingEventArgs fetchingEventArgs, IDataCacheFactory dataCacheFactory, Object sender, EventHandler`1 fetchingHandler, EventHandler`1 fetchedHandler) +356
Microsoft.Web.DistributedCache.DistributedCacheOutputCacheProvider.CreateInternalProvider(IHttpRuntime httpRuntime, OutputCacheInitializationData initData, IDataCacheFactory dataCacheFactory, EventHandler`1 cacheFetching, EventHandler`1 cacheFetched) +399
Microsoft.Web.DistributedCache.DistributedCacheOutputCacheProvider.GetInternalProvider() +315
Microsoft.Web.DistributedCache.DistributedCacheOutputCacheProvider.Get(String key) +54
System.Web.Caching.OutputCache.Get(String key) +80
System.Web.Caching.OutputCacheModule.OnEnter(Object source, EventArgs eventArgs) +341
System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +80
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +165
错误详细信息
<sessionState mode="Custom" customProvider="AFCacheSessionStateProvider" cookieName="abc_session">
<providers>
<add name="AFCacheSessionStateProvider" type="Microsoft.Web.DistributedCache.DistributedCacheSessionStateStoreProvider, Microsoft.Web.DistributedCache" cacheName="default" dataCacheClientName="default" applicationName="AFCacheSessionState" />
</providers>
</sessionState>
<outputCache defaultProvider="AFCacheOutputCacheProvider">
<providers>
<add name="AFCacheOutputCacheProvider" type="Microsoft.Web.DistributedCache.DistributedCacheOutputCacheProvider, Microsoft.Web.DistributedCache" cacheName="default" dataCacheClientName="default" applicationName="AFCacheOutputCache" />
</providers>
</outputCache>
</caching>
<dataCacheClients>
<dataCacheClient name="default">
<autoDiscover isEnabled="true" identifier="AppNameCacheWorkerRole" />
</dataCacheClient>
</dataCacheClients>
ErrorCode<ERRCA0009>:SubStatus<ES0001>:Cache referred to does not exist
[DataCacheException: ErrorCode<ERRCA0009>:SubStatus<ES0001>:Cache referred to does not exist. Contact administrator or use the Cache administration tool to create a Cache.]
Microsoft.ApplicationServer.Caching.DataCache.ThrowException(ErrStatus errStatus, Guid trackingId, Exception responseException, Byte[][] payload, EndpointID destination) +767
Microsoft.ApplicationServer.Caching.DataCache.ThrowException(ResponseBody respBody, EndpointID destination) +149
Microsoft.ApplicationServer.Caching.DataCacheFactory.EstablishConnection(IEnumerable`1 servers, RequestBody request, Func`3 sendMessageDelegate, DataCacheReadyRetryPolicy retryPolicy) +967
Microsoft.ApplicationServer.Caching.<>c__DisplayClass4.<Initialize>b__1(RequestBody req) +198
Microsoft.ApplicationServer.Caching.SocketClientProtocol.SendReceive(IVelocityRequestPacket request, Func`2 delegate, EndpointID& destination) +121
Microsoft.ApplicationServer.Caching.SocketClientProtocol.Initialize(IEnumerable`1 servers) +1011
Microsoft.ApplicationServer.Caching.DataCacheFactory.GetCache(String cacheName, CreateNewCacheDelegate cacheCreationDelegate, DataCacheInitializationViaCopyDelegate initializeDelegate) +1103
Microsoft.ApplicationServer.Caching.DataCacheFactory.GetCache(String cacheName) +131
Microsoft.Web.DistributedCache.DataCacheFactoryWrapper.CreateDataCacheFromFactory(DataCacheFactory factory, String cacheName) +63
Microsoft.Web.DistributedCache.CacheHelpers.RunCacheCreationHooks(CacheConnectingEventArgs fetchingEventArgs, IDataCacheFactory dataCacheFactory, Object sender, EventHandler`1 fetchingHandler, EventHandler`1 fetchedHandler) +356
Microsoft.Web.DistributedCache.DistributedCacheOutputCacheProvider.CreateInternalProvider(IHttpRuntime httpRuntime, OutputCacheInitializationData initData, IDataCacheFactory dataCacheFactory, EventHandler`1 cacheFetching, EventHandler`1 cacheFetched) +399
Microsoft.Web.DistributedCache.DistributedCacheOutputCacheProvider.GetInternalProvider() +315
Microsoft.Web.DistributedCache.DistributedCacheOutputCacheProvider.Get(String key) +54
System.Web.Caching.OutputCache.Get(String key) +80
System.Web.Caching.OutputCacheModule.OnEnter(Object source, EventArgs eventArgs) +341
System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +80
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +165
ErrorCode:SubStatus:引用的缓存不存在
[DataCacheException:错误代码:子状态:引用的缓存不存在。请与管理员联系或使用缓存管理工具创建缓存。]
Microsoft.ApplicationServer.Caching.DataCache.ThroweException(ErrStatus ErrStatus,Guid trackingId,Exception responseException,Byte[][]有效负载,EndpointID destination)+767
Microsoft.ApplicationServer.Caching.DataCache.ThroweException(ResponseBy respBody,EndpointID destination)+149
Microsoft.ApplicationServer.Caching.DataCacheFactory.EstablishConnection(IEnumerable`1服务器、RequestBody请求、Func`3 sendMessageDelegate、DataCacheReadyRetryPolicy retryPolicy)+967
Microsoft.ApplicationServer.Caching.c__DisplayClass4.b__1(请求主体请求)+198
Microsoft.ApplicationServer.Caching.SocketClientProtocol.SendReceive(IVelocityRequestPacket请求,Func`2委托,端点ID和目标)+121
Microsoft.ApplicationServer.Caching.SocketClientProtocol.Initialize(IEnumerable`1服务器)+1011
Microsoft.ApplicationServer.Caching.DataCacheFactory.GetCache(字符串cacheName、CreateNewCacheDelegate cacheCreationDelegate、DataCacheInitializationViacyDelegate initializeDelegate)+1103
Microsoft.ApplicationServer.Caching.DataCacheFactory.GetCache(字符串cacheName)+131
Microsoft.Web.DistributedCache.DataCacheFactoryWrapper.CreateDataCacheFromFactory(DataCacheFactory工厂,字符串cacheName)+63
Microsoft.Web.DistributedCache.CacheHelpers.RunCacheCreationHooks(CacheConnectionEventTargets fetchingEventArgs,IDataCacheFactory dataCacheFactory,Object sender,EventHandler`1 fetchingHandler,EventHandler`1 fetchedHandler)+356
Microsoft.Web.DistributedCache.DistributedCacheOutputCacheProvider.CreateInternalProvider(IHttpRuntime httpRuntime、OutputCacheInitializationData initData、IDataCacheFactory dataCacheFactory、EventHandler`1 cacheFetching、EventHandler`1 cacheFetched)+399
Microsoft.Web.DistributedCache.DistributedCacheOutputCacheProvider.GetInternalProvider()+315
Microsoft.Web.DistributedCache.DistributedCacheOutputCacheProvider.Get(字符串键)+54
System.Web.Caching.OutputCache.Get(字符串键)+80
System.Web.Caching.OutputCacheModule.OnEnter(对象源,EventArgs EventArgs)+341
System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()+80
System.Web.HttpApplication.ExecuteStep(IExecutionStep步骤,布尔值&同步完成)+165
杂项说明:
- 同样的配置在部署到Azure时可以正常工作,因此与我的本地环境有关李>
- 当我设置了多个web角色实例时,IIS Express崩溃了,我找到了运行Visual Studio 2010 SP1以解决此问题的建议。我在系统上安装了VS2010,因为一个工具(相信是SQL)安装了它。安装SP1解决了IIS Express崩溃的问题,但此错误再次出现李>
- 如果我注释掉上面列出的OutputCache节点,错误就会消失
- 如果我将缓存工作人员角色从专用角色切换到位于同一位置的角色,错误就会消失