Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/sockets/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# Azure会话缓存错误_C#_Asp.net Mvc 3_Azure_Azure Caching - Fatal编程技术网

C# Azure会话缓存错误

C# Azure会话缓存错误,c#,asp.net-mvc-3,azure,azure-caching,C#,Asp.net Mvc 3,Azure,Azure Caching,我开始反复抛出Azure缓存错误。这似乎与过期的会话有关。这是一个随机样本-它发生在静态文件中 Event code: 3005 Event message: An unhandled exception has occurred. Event time: 10/25/2012 9:49:15 AM Event time (UTC): 10/25/2012 9:49:15 AM Event ID: 004e617f16854e59b7a857ca542ae9fc Event seque

我开始反复抛出Azure缓存错误。这似乎与过期的会话有关。这是一个随机样本-它发生在静态文件中

Event code: 3005 Event message: An unhandled exception has occurred. Event time: 10/25/2012 9:49:15 AM Event time (UTC): 10/25/2012 9:49:15 AM Event ID: 004e617f16854e59b7a857ca542ae9fc Event sequence: 86004 Event occurrence: 720 Event detail code: 0 Application information: Application domain: /LM/W3SVC/1273337584/ROOT-1-129955415508042441 Trust level: Full Application Virtual Path: / Application Path: E:\sitesroot\0\ Machine name: RD00155D36A377 Process information: Process ID: 3332 Process name: w3wp.exe Account name: NT AUTHORITY\NETWORK SERVICE Exception information: Exception type: DataCacheException Exception message: ErrorCode:SubStatus:Key referred to does not exist. Create objects based on a Key to fix the error. at Microsoft.ApplicationServer.Caching.DataCache.ThrowException(ResponseBody respBody) at Microsoft.ApplicationServer.Caching.DataCache.ExecuteAPI(RequestBody reqMsg, IMonitoringListener listener) at Microsoft.ApplicationServer.Caching.DataCache.InternalResetObjectTimeout(String key, TimeSpan newTimeout, String region, IMonitoringListener listener) at Microsoft.ApplicationServer.Caching.DataCache.c__DisplayClass68.b__67() at Microsoft.ApplicationServer.Caching.DataCache.ResetObjectTimeout(String key, TimeSpan newTimeout) at Microsoft.Web.DistributedCache.DataCacheRetryWrapper.PerformCacheOperation(Action action) at Microsoft.Web.DistributedCache.DataCacheForwarderBase.ResetObjectTimeout(String key, TimeSpan newTimeout) at System.Web.SessionState.SessionStateModule.BeginAcquireState(Object source, EventArgs e, AsyncCallback cb, Object extraData) at System.Web.HttpApplication.AsyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) Request information: Request URL: http://www.beko.co.uk/Scripts/jquery.nivo.slider.pack.js Request path: /Scripts/jquery.nivo.slider.pack.js User host address: 80.2.72.81 User: Is authenticated: False Authentication Type: Thread account name: NT AUTHORITY\NETWORK SERVICE Thread information: Thread ID: 11 Thread account name: NT AUTHORITY\NETWORK SERVICE Is impersonating: False Stack trace: at Microsoft.ApplicationServer.Caching.DataCache.ThrowException(ResponseBody respBody) at Microsoft.ApplicationServer.Caching.DataCache.ExecuteAPI(RequestBody reqMsg, IMonitoringListener listener) at Microsoft.ApplicationServer.Caching.DataCache.InternalResetObjectTimeout(String key, TimeSpan newTimeout, String region, IMonitoringListener listener) at Microsoft.ApplicationServer.Caching.DataCache.c__DisplayClass68.b__67() at Microsoft.ApplicationServer.Caching.DataCache.ResetObjectTimeout(String key, TimeSpan newTimeout) at Microsoft.Web.DistributedCache.DataCacheRetryWrapper.PerformCacheOperation(Action action) at Microsoft.Web.DistributedCache.DataCacheForwarderBase.ResetObjectTimeout(String key, TimeSpan newTimeout) at System.Web.SessionState.SessionStateModule.BeginAcquireState(Object source, EventArgs e, AsyncCallback cb, Object extraData) at System.Web.HttpApplication.AsyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) 活动编号:3005 事件消息:发生未处理的异常。 活动时间:2012年10月25日上午9:49:15 事件时间(UTC):2012年10月25日上午9:49:15 事件ID:004e617f16854e59b7a857ca542ae9fc 事件顺序:86004 事件发生率:720 事件详细信息代码:0 申请资料: 应用程序域:/LM/W3SVC/1273337584/ROOT-1-12995541550804241 信任级别:完全信任 应用程序虚拟路径:/ 应用程序路径:E:\sitesroot\0\ 机器名称:RD00155D36A377 过程信息: 进程ID:3332 进程名称:w3wp.exe 帐户名称:NT授权\网络服务 例外信息: 异常类型:DataCacheException 异常消息:错误代码:子状态:引用的密钥不存在。基于密钥创建对象以修复错误。 位于Microsoft.ApplicationServer.Caching.DataCache.ThroweException(ResponseBy respBody) 位于Microsoft.ApplicationServer.Caching.DataCache.ExecuteAPI(RequestBody reqMsg,IMonitoringListener侦听器) 在Microsoft.ApplicationServer.Caching.DataCache.InternalResetObjectTimeout(字符串键、TimeSpan newTimeout、字符串区域、IMonitoringListener侦听器) 在Microsoft.ApplicationServer.Caching.DataCache.c__DisplayClass68.b__67()中 位于Microsoft.ApplicationServer.Caching.DataCache.ResetObjectTimeout(字符串键,TimeSpan-newTimeout) 位于Microsoft.Web.DistributedCache.DataCacheRetryWrapper.PerformCacheOperation(操作) 位于Microsoft.Web.DistributedCache.DataCacheForwarderBase.ResetObjectTimeout(字符串键,TimeSpan-newTimeout) 位于System.Web.SessionState.SessionStateModule.BeginAcquireState(对象源、事件参数e、异步回调cb、对象外部数据) 在System.Web.HttpApplication.AsyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()中 在System.Web.HttpApplication.ExecuteStep(IExecutionStep步骤,布尔值&同步完成) 请求信息: 请求URL:http://www.beko.co.uk/Scripts/jquery.nivo.slider.pack.js 请求路径:/Scripts/jquery.nivo.slider.pack.js 用户主机地址:80.2.72.81 用户: 已验证:False 身份验证类型: 线程帐户名称:NT授权\网络服务 线程信息: 线程ID:11 线程帐户名称:NT授权\网络服务 是模仿:假 堆栈跟踪:位于Microsoft.ApplicationServer.Caching.DataCache.ThroweException(ResponseBy respBody) 位于Microsoft.ApplicationServer.Caching.DataCache.ExecuteAPI(RequestBody reqMsg,IMonitoringListener侦听器) 在Microsoft.ApplicationServer.Caching.DataCache.InternalResetObjectTimeout(字符串键、TimeSpan newTimeout、字符串区域、IMonitoringListener侦听器) 在Microsoft.ApplicationServer.Caching.DataCache.c__DisplayClass68.b__67()中 位于Microsoft.ApplicationServer.Caching.DataCache.ResetObjectTimeout(字符串键,TimeSpan-newTimeout) 位于Microsoft.Web.DistributedCache.DataCacheRetryWrapper.PerformCacheOperation(操作) 位于Microsoft.Web.DistributedCache.DataCacheForwarderBase.ResetObjectTimeout(字符串键,TimeSpan-newTimeout) 位于System.Web.SessionState.SessionStateModule.BeginAcquireState(对象源、事件参数e、异步回调cb、对象外部数据) 在System.Web.HttpApplication.AsyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()中 在System.Web.HttpApplication.ExecuteStep(IExecutionStep步骤,布尔值&同步完成) 这方面没有代码,它是在web.config中配置的

<dataCacheClients>
  <dataCacheClient name="default">
    <hosts>
      <host name="[mycachename]" cachePort="22233" />
    </hosts>
    <securityProperties mode="Message">
      <messageSecurity authorizationInfo="[mykey]"></messageSecurity>
    </securityProperties>
  </dataCacheClient>
  <dataCacheClient name="SslEndpoint">
    <hosts>
      <host name="[mycachename]" cachePort="22243" />
    </hosts>
    <securityProperties mode="Message" sslEnabled="true">
      <messageSecurity authorizationInfo="[mykey]"></messageSecurity>
    </securityProperties>
  </dataCacheClient>
</dataCacheClients>

编辑:会话状态配置如下:

<sessionState mode="Custom" customProvider="AppFabricCacheSessionStoreProvider">
  <providers>
    <add name="AppFabricCacheSessionStoreProvider" type="Microsoft.Web.DistributedCache.DistributedCacheSessionStateStoreProvider, Microsoft.Web.DistributedCache" cacheName="default" useBlobMode="true" dataCacheClientName="default" />
  </providers>
</sessionState>

我想知道是否有 a) 我能在配置中做些什么来修复这个问题 b) 涉及哪些DLL,最新版本是什么(因此我可以查看更新是否有帮助) c) 如果有人看到了


它是在我做了很多应用程序更新之后开始的,我还更新了Azure中的缓存大小。因此不确定原因是什么。我不认为是代码更改造成的,但有可能我们更新了一些DLL,因为我们在开发过程中使用的一台PC是新建的。

我通过nuget更新了azure.caching和azure.configuration,然后重新发布,错误现在消失了,没有其他代码或配置更改,看来这是DLL版本之间的不兼容。

您在webconfig中添加了自定义会话状态提供程序的配置了吗?这是您在webconfig中添加的唯一一个使用azure缓存处理会话的部分吗?您是否也为sslendpoint添加了提供程序?这不是我上面问题中的一节吗?还有什么吗?根据我对中提供程序的介绍,您需要使用dataCacheClientName=“SslEndpoint”添加另一个提供程序。如何将
/Scripts/jquery.nivo.slider.pack.js
添加到数据缓存中?您有多个实例还是只有一个角色实例?