Sunday, January 25, 2009

Request is not available in this context - Resolution

I have a web application (ASP.NET) using IIS 6.0 in my machine.
I have prepared a web application set up of this web site.

Then I have copied and installed this web application set up in my friend’s machine which is having IIS 7.0.
I felt that after installing this web set up in that machine, it works fine.

Set up runnned well and I found the web folder created in the core folder (c:\Inetpub\wwwroot\).

But after browsing the web application for login page, it is giving a strange error saying”Request is not available in this context”.





I am having global.asax file for this web site in which under “Applcation_start” event I am using “HttpContext.Current.Request” function to read some xml file available in the root directory.
While surfing through google, I found that in IIS 7.0, we cannot use this request object in application start event.
As of now to make my web application to be worked, I found a temporary solution.
Step 1:
I opened Inetmgr (Internet Information Service manager(IIS)).
Under my machine name tab,I have selected “Applcation pools” and said “Set Applicaition pool defaults..”.




I have changed “Managed pipeline mode” value from “Integrated” to “Classic”.





There after doing this, when I have tried to browse my web application. It worked fine.




No comments: