1

I have some code which is working perfectly on my localhost IIS and was working perfectly on my dedicated server. I recently migrated the .net mvc application to an Azure web app, and I am now seeing this error when making this call:

var client = new System.Net.WebClient();
client.DownloadFile(uri, Path.Combine(HttpContext.Current.Server.MapPath("/Images/headshots"), seekerID + ".jpg"));

[DirectoryNotFoundException: Could not find a part of the path 'D:\home\site\wwwroot\Images\headshots\14.jpg'.]

I suspect it has something to do with permissions on azure, but am at a loss as how to fix.

mikerennick
  • 385
  • 2
  • 15
  • Take a look at the other question's answer, which shows the proper way to map the path starting at `~/...` – David Makogon Aug 26 '15 at 15:47
  • My issue was not the ~....it was the fact that the folder was not being published as it held only hidden files on my local end... – mikerennick Aug 26 '15 at 17:59

0 Answers0