时HttpContext.Current在Web应用程序不断为空(未使用假设线程)?更具体地说,它会永远是空的无效Application_OnError(对象发件人,EventArgs五)?
Is HttpContext.Current ever null in a web Application (assuming threads are not being used)? More specifically, would it ever be null in void Application_OnError(object sender, EventArgs e)?
推荐答案看this另一个问题
会议未初始化,直到AcquireRequestState事件添加,所以这点之前发生的任何错误将不会有会话变量。
Session is not initialized until the AcquireRequestState event, so any error occurring before this point will not have session variables available.
我认为同样适用于HttpContext.Current为HttpContext.Current.Session
I think the same applies to HttpContext.Current as HttpContext.Current.Session
所以,是的,我认为HttpContext.Current有时是空的Application_OnError
So yes, I think HttpContext.Current can sometimes be null in Application_OnError
更多推荐
是HttpContext.Current在Web应用程序自从空?
发布评论