http-context

How to access the HttpServerUtility.MapPath method in a Thread or Timer ?

Hi, I use a System.Timers.Timer in my Asp.Net application and I need to use the HttpServerUtility.MapPath method which seems to be only available via HttpContext.Current.Server.MapPath. The problem is that HttpContext.Current is null when the Timer.Elapsed event fires. Is there another way to get a reference to a HttpServerUtility obje...

Mocking a HttpContext Response.Output with Moq

I've been using the MvcMockHelpers class found at Hanselman's blog for passing in a mocked HttpContext. We extended it somewhat to add some authentication data we needed and for the most part this has been great. The issue we are having is that the context we are giving to the controller has a null value in the HttpContext.Response.Outp...