ASP.Net - Request is not available in this context

Posted by Blake on 10/8/2013


You receive the Exception “Request is not available in this context” when referencing the HttpContext.Current.Request in the Application_Start of your ASP.NET site. In .Net 3.5 you could by default access the context from the Application_Start event but in .Net 4.0 the default behavior changed.


  1. In the solution properties for the site you have the option of using Integrated Mode of Classic Mode. If you change it Classic Mode you will be able to access this and mitigate this error. To generalize briefly, Classic Mode is the pipeline that IIS6 would have used while Integrated Mode is the one IIS7 and IIS8 use. If your application was designed for IIS6 and you have to move to a new server this may help you make that move in the short term.
  2. Change your logic and remove the request code from the Application_Start event. This is what I would recommend as opposed to changing the pipeline.