Finding the application path in a module timer RRS feed

  • Question

  • User-1293453231 posted
    Here's a pickle (to me, anyway)... How do you determine an application's path from an HttpModule inside of a running timer? I tried the obvious by passing in the application context and looking it up from Request.ApplicationPath, but that works only when the app first starts. Code looks something like this... public class Module : IHttpModule { public void Init(HttpApplication application) { timer = new Timer(new TimerCallback(this.myMethod), application.Context, TimeSpan.Zero, new TimeSpan(0, 15, 0)); } static Timer timer; private void myMethod(object sender) { // this works the first time, but not on subsequent calls string path = ((HttpContext)sender).Request.ApplicationPath; } public void Dispose() { timer.Dispose(); } }
    Thursday, February 17, 2005 4:00 PM

All replies

  • User-1293453231 posted
    Nevermind... HttpRuntime.AppDomainAppPath
    Thursday, February 17, 2005 5:37 PM