What I must do to make Server.MapPath
work?
I have using System.Web;
what else? When I type Server
there is no quick resu
System.Web.HttpContext.Current.Server.MapPath("~/")
gives null if we call it from a thread.
So, Try to use
System.Web.Hosting.HostingEnvironment.MapPath("~/")
Firt add a reference to System.web
, if you don't have. Do that in the References folder.
You can then use Hosting.HostingEnvironment.MapPath(path);