Loading ...

File.Move: Access to the path is denied | CodeAsp.Net

File.Move: Access to the path is denied

 /5
0 (0votes)

While using the File.Move method to move a file from one location to other:

File.Move(oldPath, newPath);

I was getting the following exception: Access to the path is denied. Exception Details: System.UnauthorizedAccessException: Access to the path is denied. 

The fix for this was to give IIS_IUSRS account full control permissions:

 

After giving the permissions the issue was fixed.

Comments (no comments yet)

Top Posts