Could Not Find Part of Path RRS feed

  • Question

  • User-449230355 posted

    Need help with a web application I am writing in ASP.NET the code runs fine on LocalHost but bombs with a ‘Could not find part of path’ error when I try to run it on the server (IIS 7.5 on Windows Server 2008 R2). 

    What is bombing is a section where I am testing to see if a directory exists (If Directory.Exists) on our network transfer drive named after the users logon name so I am pretty certain my problem is permission or security related (see below). 

     I am already using impersonation in the sites Web.config file (see below) for other applications and I authenticate the user to our active directory based on their username (environment.username) and their form entered network password.

     I have tried using UNCs (the error becomes 'access to path is denied') also a security manager class I came across and two methods to directly map the drives I need all to no avail.

     What I need to be able to do is to copy a prototype file from one network location to this user transfer folder under another name as well as write a CSV file to the same location.

     This is what MSDN has to say:

    A service that runs under a LocalSystem account or under a local user account can only access mapped drives that the service creates. Mapped drives are stored for each logon session. If a service runs under a LocalSystem account or under a local user account that does not create certain mapped drives, the service cannot access these mapped drives. Additionally, a service that runs under a local user account that creates certain mapped drives also receives a new set of mapped drives if you log off and then you log on again as the same local user.

     Any help will be appreciated.



    <authentication mode="Windows"/>

    <authorization> <deny users="?"/> </authorization>

    <identity impersonate="true"/>

    Tuesday, May 5, 2015 2:15 PM


  • User1104055534 posted

    Hi Searaven23,

    Thank you post here.

    IIS access files or folders not use the account logged in but the build-in account for IIS, like IIS_ISURS group. You should set the file or folder access permission against this account then IIS or application pool should access them during run-time.

    Please refer to the below link for general settings steps:

    Best Regards,

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Sunday, May 24, 2015 10:23 PM