Using MapPath in .net Task

When using the Task factory in ASP.net you will not be able to use the current HttpContext in the started task. Hence no HttpContext.Current.Server.MapPath(). To substitute this you can use System.Web.Hosting.HostingEnvironment.MapPath() instead.