User-1247255703 posted
Hi All,
I am getting an index out of bound error at odd times and completely random and only to some users. Below is the stack trace. Any idea? I tried Locking the object as per a previous thread but doesn't seem to help. Any idea why would this be occurring?
I get Line 17: If Not OnlineVisitorsUtility.Visitors.ContainsKey(currentContext.Session.SessionID) Then Line 18: If HttpContext.Current.User.Identity.Name = [String].Empty Then Line 19: OnlineVisitorsUtility.Visitors.Add(currentContext.Session.SessionID,
New WebsiteVisitor(currentContext)) Line 20: Else Line 21: OnlineVisitorsUtility.Visitors.Add(currentContext.Session.SessionID, New WebsiteVisitor(currentContext, HttpContext.Current.User.Identity.Name))
Source File:global.asax Line: 19
Stack Trace:
[IndexOutOfRangeException: Index was outside the bounds of the array.] System.Collections.Generic.Dictionary2.Insert(TKey key, TValue value, Boolean add) +10425621 System.Collections.Generic.Dictionary
2.Add(TKey key, TValue value) +12 ASP.global_asax.Session_Start(Object
sender, EventArgs e) in D:\Projects\global.asax:19 System.Web.SessionState.SessionStateModule.RaiseOnStart(EventArgs e) +11278204 System.Web.SessionState.SessionStateModule.CompleteAcquireState() +366 System.Web.SessionState.SessionStateModule.BeginAcquireState(Object
source, EventArgs e, AsyncCallback cb, Object extraData) +1281 System.Web.AsyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +85 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +263