Global asax application_start begin_request?

I have a problem. When going from classic pipeline mode to integrated pipeline mode in IIS 7.0, we are faced with the problem:

Server error in application "/".

The request is not available in this context ...

We have found a solution to this problem for

mvolo.com/blogs/serverside/archive/2007/11/10/Integrated-mode-Request-is-not-available-in-this-context-in-Application_5F00_Start.aspx

      

As a solution soon in global.asax, I have to send the application_start event to the Application_BeginRequest event .

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' }

      

Or another solution: Application_Start event can start later than Application_BeginRequest .

any suggestions? I have no choice but to choose "classic mode"

+1


a source to share


2 answers


Move the code to Application_BeginRequest

or Session_Start

. You should not use the object Request

in Application_Start

anyway.



The object Request

contains information specific to a single page request. It doesn't really make sense to do anything with this information in an event Application_Start

.

+3


a source


So, change the application pool mode to classic.



0


a source







All Articles