【发布时间】:2010-10-28 18:02:25
【问题描述】:
我有问题。在 IIS 7.0 从经典管道模式迁移到集成管道模式时,我们遇到了问题:
“/”应用程序中的服务器错误。
请求在此上下文中不可用...
我们在
找到了解决此问题的方法mvolo.com/blogs/serverside/archive/2007/11/10/Integrated-mode-Request-is-not-available-in-this-context-in-Application_5F00_Start.aspx
作为解决方案,在 global.asax 中,我必须将 application_start 事件转发到 Application_BeginRequest 事件。
void Application_Start(object sender, EventArgs e) { // sender has type 'System.Web.HttpApplicationFactory' }
Application_BeginRequest(Object source, EventArgs e) | {
// sender has type 'System.Web.HttpApplication' }
或者另一种解决方案是,Application_Start 事件可以在 Application_BeginRequest 之后开始。
有什么建议吗? 我没有选择“经典模式”这样的选择
【问题讨论】:
标签: iis-7 global-asax httpapplication