I have an asp.net webapplication that uploads files to a specific folder on the Web server. locally everything works fine, but when I deploy the application to the Webserver
I know this is late to the game, but I wanted to share in case it helps someone.
Your exact situation may not apply, however I had a similar situation and setting the File attribute helped.
Try to set the File attribute to Normal:
var path = Server.MapPath("~/App_Data/file.txt");
File.SetAttributes(path, FileAttributes.Normal);
System.IO.File.WriteAllText(path, "Hello World");
I hope this helps someone.