IIS工作进程SessionState.SessionStateItemCollection.get_Item(Int32)处出现NullReferenceException

ctzwtxfj  于 2023-06-23  发布在  其他
关注(0)|答案(1)|浏览(83)

我的一个客户的Kentico-9网站似乎在随机的时间崩溃。
我检查了windows服务器错误日志,并找到了错误的堆栈跟踪。

Application: w3wp.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.NullReferenceException
   at System.Web.SessionState.SessionStateItemCollection.get_Item(Int32)
   at System.Web.SessionState.HttpSessionStateContainer.get_Item(Int32)
   at System.Web.Util.AspCompatApplicationStep.AnyStaObjectsInSessionState(System.Web.SessionState.HttpSessionState)
   at System.Web.HttpApplicationFactory.FireSessionOnEnd(System.Web.SessionState.HttpSessionState, System.Object, System.EventArgs)
   at System.Web.SessionState.SessionOnEndTargetWorkItem.RaiseOnEndCallback()
   at System.Web.Util.WorkItem.CallCallbackWithAssert(System.Web.Util.WorkItemCallback)
   at System.Web.Util.WorkItem.OnQueueUserWorkItemCompletion(System.Object)
   at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(System.Object)
   at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
   at System.Threading.ThreadPoolWorkQueue.Dispatch()
   at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()

从那里,我已经设置了转储应用程序池进程到异常,希望它会导致更多的信息,但这似乎没有包含任何新的内容。
任何帮助将不胜感激。

slsn1g29

slsn1g291#

  • 未来参考:*

我们有完全相同的问题,并通过将我们的异步处理程序中的会话访问从只读改为rw来修复它。
IReadOnlySessionStateIRequiresSessionState

public class MyHandler : IHttpHandler, IRequiresSessionState
{ 
   ...
}

正如建议的here,如果你在MVC中使用[SessionState(SessionStateBehavior.ReadOnly)]属性,这似乎也是相关的。

相关问题