Visual Studio Publish Failed: “Unable to delete file … Access to the path … is denied.”

前端 未结 11 1243
生来不讨喜
生来不讨喜 2021-02-12 13:43

I\'ve recently switched from a Windows XP machine to Windows 7. I use Subversion and TortoiseSVN.

I cannot publish my .NET application in Visual Studio. I get over a tho

相关标签:
11条回答
  • 2021-02-12 14:18

    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

    1. Save the changes to that directory (check in if necessary)
    2. Delete the repository
    3. Re-check out the repository and ensure you are not running as an admin when doing so
    0 讨论(0)
  • 2021-02-12 14:22

    I noticed that my folders were read-only. I changed that.

    It worked! Publish succeeded.

    Folder Properties Read-only

    0 讨论(0)
  • 2021-02-12 14:24

    I just deleted the existing folders at the publish destination which then allowed publishing to work. Un-setting read-only didn't seem to work. (Not sure why this started occurring).

    0 讨论(0)
  • 2021-02-12 14:26

    My problem resolved after doing:

    1. Close VS and Restart your machine.
    2. Update all your softwares to latest stable versions at Manage Nuget package for solution
    3. Run your test now.

    Hope this helps.

    0 讨论(0)
  • 2021-02-12 14:28

    Right click on the shortcut you start the IDE from and select properties. Click advanced and click'Run as Administrator'. Worked as charm for me.

    0 讨论(0)
提交回复
热议问题