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

前端 未结 11 943
无人及你
无人及你 2021-02-12 13:25

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:05

    What actually works is the solution that Zack Peterson gave? Thanks Zack!

    I am writing an application that will automatically remove all of the .SVN folders and files during deployment. While doing so, I was getting the same error as described above.

    • Once I changed the folder to NOT be Read Only, I was able to delete files and folders programmatically.
    • My next step is to set the attribute programmatically on NOT Read Only so that I can accomplish the entire installation with the click of a button.
    0 讨论(0)
  • 2021-02-12 14:08

    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:11

    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)
  • 2021-02-12 14:11

    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:14

    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:15

    I had this same problem, and none of the previous solutions worked. What worked for me was to take the bin and obj folders out of repository. After doing that, I was able to publish.

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