I have an Azure Cloud service with a WCF web role. I am trying to access a file in App_Data and I do not want to hardcode the path. I tried using:
System.Web.HostingEnviroment.MapPath("~/App_Data/myfile");
as well as enabling aspNetCompatibilityEnabled and using Server.MapPath()
but both paths return:
d: \ Windows \ system32 \ Inetsrv \ App_Data \ MyFile
Actual file location:
E: \ sitesroot \ 0 \ App_Data \ MyFile
Is there any way to access this file that does not have hard-coding paths?
source
share