Far*_*day 7 c# session-state redis stackexchange.redis
我的代码中出现了间歇性错误.当我使用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>
Run Code Online (Sandbox Code Playgroud)
我从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
Run Code Online (Sandbox Code Playgroud)