Ubiquitous way to get the file system root of a .NET WEB application

Posted by Eddie on Stack Overflow See other posts from Stack Overflow or by Eddie
Published on 2010-03-25T17:22:54Z Indexed on 2010/03/25 17:23 UTC
Read the original article Hit count: 345

Filed under:
|
|

Similar to Ubiquitous way to get the root directory an application is running in via C#, but that question seems to be related to Win Forms. How would the same be done for Web Forms?

I was using...

HttpContext.Current.Server.MapPath("~")

This works great for handling HTTP requests but seems not to work if a scheduler like Quartz.NET invokes a job (the problem I am having). The HttpContext.Current is null in that scenario since an actual HTTP request is not made.

© Stack Overflow or respective owner

Related posts about c#

Related posts about .NET