Visual Studio Publish Failed: "Unable to delete file ... Access to the path ... is denied."
I noticed that my folders were read-only. I changed that.
It worked! Publish succeeded.
I believe your issue is related to the default permissions assigned the to C: drive in windows 7 (and Vista).
- Open explorer and find the c:\code folder
- Right click on the c:\code folder and select properties
- select the security tab
- select the user ID "Users"
- In the permissions box, tick the "modify" allow box
- Select OK, OK until permision dialog boxes close
That should resolve the permission issue
The most likely cause is a permissions issue. The path in question may have been created while you were running with elevated permissions and hence requires admin permissions to delete. Try running Visual Studio as an admin and see if the problem goes away.
If so then the best solution is to do the following
- Save the changes to that directory (check in if necessary)
- Delete the repository
- Re-check out the repository and ensure you are not running as an admin when doing so