Finding My Virtual Directory During Application_Start Event

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I realize that I could find my virtual directory using some of the methods in the HttpRequest object, but since the HttpRequest object is not in context during the Application_Start event, I'm at a loss for how to determine what virtual directory my web application is running in. Any suggestions?
 
HttpContext.Current.Request.ApplicationPath

Nathan Phelps said:
I realize that I could find my virtual directory using some of the methods
in the HttpRequest object, but since the HttpRequest object is not in
context during the Application_Start event, I'm at a loss for how to
determine what virtual directory my web application is running in. Any
suggestions?
 
Sorry for jumping on this ... didn't see that you've already stated that the
HttpRequest object is null during application_start. I've run into the same
problem -- only during design time. If anyone know of any objects that
would provide this, I'm interested in the answer as well. I ended up just
using the context at the page level and only during run-time.

Thanks, Sam
 
Back
Top