7

我的代码中出现了间歇性错误。当我使用 Visual Studio 调试它时,所有异常(捕获和未捕获)都会中断,所以我不知道该怎么做。

看起来它是堆栈跟踪中的会话状态提供程序,这是配置:

<sessionState mode="Custom" customProvider="RedisSessionProvider">
  <providers>
    <add name="RedisSessionProvider" type="Microsoft.Web.Redis.RedisSessionStateProvider" port="6380" host="2asdasdasdasd.redis.cache.windows.net" accessKey="2asdasdasdasd=" ssl="true" />
  </providers>
</sessionState>

我从 NuGet 安装了 StackExchange.Redis,我正在运行 1.0.297。我无法定期重现这种情况,我尝试了各种浏览器和操作系统,但它只是“有时”发生。

这是堆栈跟踪:

Object reference not set to an instance of an object.Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

Source Error: 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace: 
[NullReferenceException: Object reference not set to an instance of an object.]
   Microsoft.Web.Redis.StackExchangeClientConnection.Eval(String script, String[] keyArgs, Object[] valueArgs) +246
   Microsoft.Web.Redis.RedisConnectionWrapper.Set(ISessionStateItemCollection data, Int32 sessionTimeout) +60
   Microsoft.Web.Redis.RedisSessionStateProvider.SetAndReleaseItemExclusive(HttpContext context, String id, SessionStateStoreData item, Object lockId, Boolean newItem) +802
   System.Web.SessionState.SessionStateModule.OnReleaseState(Object source, EventArgs eventArgs) +565
   System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +136
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +69
4

0 回答 0