SyntaxFix
Write A Post
Hire A Developer
Questions
System.Web.HttpContext.Current.Server.MapPath("~/") gives null if we call it from a thread.
System.Web.HttpContext.Current.Server.MapPath("~/")
So, Try to use
System.Web.Hosting.HostingEnvironment.MapPath("~/")