WebActivator - access to the Server object / current directory

154 Views Asked by At

I have a WebActivator bootstrapper that needs access to the Server property. Specifically, it needs to know what Server.MapPath("~") is.

Is there a way to do this?

1

There are 1 best solutions below

0
On BEST ANSWER

The best way to do this is to just call HttpRuntime.AppDomainAppPath.

Or if you want to call MapPath on arbitrary paths, use System.Web.Hosting.HostingEnvironment.MapPath("~/some/file.aspx").