-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cast Error when using Trace #15
Comments
Thanks for bringing this to my attention :) |
The cause of this issue is that TraceContext expects that HttpSessionState would enumerate strings as described here:
But RedisSessionStateItemCollection in fact falls back to Dictionary<string, object> implementation of GetEnumerator(). |
I've created a pull request which I think should fix this problem. |
Hi welegan! The issue might prevent from using this library in production systems because with RedisSessionProvider this https://msdn.microsoft.com/en-us/library/system.web.sessionstate.httpsessionstate.getenumerator(v=vs.110).aspx is never gonna work. |
Thanks for a great implementation of a Redis Session provider!
I found a bug when Trace is enabled (have it at the application level). In web.config
<system.web>
<trace enabled="true" requestLimit="90" pageOutput="false" traceMode="SortByTime" localOnly="false" />
</system.web>
Causes this exception
Exception: System.InvalidCastException
Unable to cast object of type 'System.Collections.Generic.KeyValuePair`2[System.String,System.Object]' to type 'System.String'.
at System.Web.TraceContext.EndRequest()
at System.Web.UI.Page.ProcessRequestEndTrace()
at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest()
at System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context)
at System.Web.UI.Page.ProcessRequest(HttpContext context)
at ASP.sobobacasino_default_aspx.ProcessRequest(HttpContext context) in c:\Users\dcate.MARKETMETRIX\AppData\Local\Temp\Temporary ASP.NET Files\root\ec897ff3\55745380\App_Web_qw3cpivu.0.cs:line 0
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
I can run fine with Trace turned off, but it might be needed from time to time.
Thanks,
The text was updated successfully, but these errors were encountered: