I think you can try this for a call from class
System.Web.HttpContext.Current.Server.MapPath("~/SignatureImages/");
* ---------------- Sorry, I tried because the static function has already answered the question with drift *
System.Web.Hosting.HostingEnvironment.MapPath("~/SignatureImages/");
Update
I have an exception when using System.Web.Hosting.HostingEnvironment.MapPath("~/SignatureImages/");
Details: System.ArgumentException: The relative virtual path 'SignatureImages' is not allowed here. in System.Web.VirtualPath.FailIfRelativePath ()
Solution (tested on static web method)
System.Web.HttpContext.Current.Server.MapPath("~/SignatureImages/"); Worked
panky sharma Oct 26 '13 at 14:22 2013-10-26 14:22
source share