UnauthorizedAccessException error

Discussion in 'Site Programming, Development and Design' started by mangia, Nov 18, 2012.

  1. My ASP.NET site is attempting to upload and download files from our site. I have Full Trust set is my web.config yet C# code is not able to do basic file i/o (exist, create directory, write file, delete file).

    for example:
    string ordersFolder = Server.MapPath("/SubDirectory/");
    if (!System.IO.Directory.Exists(ordersFolder + "myFolder") {...}

    ...generates System.UnauthorizedAccessException error

    This works fine on local system but not on site. Please advise :confused:
  2. rum

    rum Winhost Staff

    There could be an issue with the ACL permissions of ASPNet IUSR set to read-only by Web Deploy. Please see this article for more information. Please contact technical support so we can check the permissions on your site.
    Last edited by a moderator: Oct 14, 2015
  3. Yes, that's what it was. I used VS Web Deploy once!! Never again, FTP is just as easy and I'm feel more in control. Winhost reset the permissions for me. thanks
    Last edited by a moderator: Oct 14, 2015

Share This Page