C# – Cannot use Server.MapPath

cintellisenseserver.mappathvisual studio

What I must do to make Server.MapPath work?
I have using System.Web;

what else? When I type Server there is no quick result option (intelli-sense) for Server.

Any help?

Best Answer

you can try using this

    System.Web.HttpContext.Current.Server.MapPath(path);

or use HostingEnvironment.MapPath

    System.Web.Hosting.HostingEnvironment.MapPath(path);