Request is not available in this context

Posted by Vishal Seth on Stack Overflow See other posts from Stack Overflow or by Vishal Seth
Published on 2010-03-25T17:48:39Z Indexed on 2010/03/25 17:53 UTC
Read the original article Hit count: 378

Filed under:
|

I'm running IIS 7 Integrated mode and I'm getting

Request is not available in this context

when I try to access it in a Log4Net related function that is called from Application_Start. This is the line of code I've

if (HttpContext.Current != null && HttpContext.Current.Request != null)

and an exception is being thrown for second comparison.

What else can I check other than checking HttpContext.Current.Request for null??


A similar question is posted @ http://stackoverflow.com/questions/2056398/request-is-not-available-in-this-context-exception-when-runnig-mvc-on-iis7-5

but no relevant answer there either.

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about iis7