Iis 7 全局asax应用程序\u启动应用程序开始\u请求方法?

Iis 7 全局asax应用程序\u启动应用程序开始\u请求方法?,iis-7,global-asax,httpapplication,Iis 7,Global Asax,Httpapplication,我有个问题。在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中,我必须将应

我有个问题。在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中,我必须将应用程序启动事件转发到应用程序启动请求事件

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' }
或者另一种解决方案是,应用程序启动事件可以稍后启动,然后应用程序开始请求

有什么建议吗?
我没有选择“经典模式”的选项,因此,请将应用程序池模式更改为经典模式。

将代码移动到
应用程序开始请求
会话开始
。无论如何,您不应该在
应用程序启动
中使用
请求
对象


Request
对象包含特定于一页请求的信息。在
应用程序启动
事件中使用此信息实际上没有任何意义。

这不是我的选项。我与会话或会话启动无关。我需要的基本上是在Application_start事件之前调用Application_BeginRequest事件,或者使用有效参数从app_start调用begin_request方法。您不能更改事件的顺序,应用程序必须在处理请求之前启动。为什么在有请求之前需要请求对象?