I have a few fonts and a PDF file in the App_Data directory of my Web API project which is published to an Azure Mobile Service.
The build action is set to Content and I can see in the output window that the files are being published but when my code runs it cannot find the directory anywhere.
Assembly.GetExecutingAssembly().Location
Yields
"D:\\local\\Temporary ASP.NET Files\\root\\aea53938\\87de4b2f\\assembly\\dl3\\fb538bd2\\f38b146c_6ea3d001\\
Both of these
HostingEnvironment.ApplicationPhysicalPath
HostingEnvironment.MapPath("~/")
Yield
C:\\Program Files (x86)\\SiteExtensions\\MobileServicesDotNet\\1.0.450\\
If I do a Directory.GetFiles() and Directory.GetDirectories() using the directories above, none of them show an App_Data folder.
Where is this mystery folder located? Several Stackoverflow posts have suggested looking in bin\App_Data but it's not there either.
Try
D:\home\site\wwwroot\App_Data