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

前端 未结 11 944
无人及你
无人及你 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:20

    If you are being denied access to any specific folder, then it is being used by some other application.Check if any other application is using that path to reference that folder of any file in that folder. In my case , my application was reference a file inside the bin folder. So every time i publish and delete the old one. error will be thrown that bin folder can not be deleted. access denied. i went in my application. checked in the refrenced path of each dll, removed the ones which referenced the publish path and BOOM Issue solved.

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

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

    I believe your issue is related to the default permissions assigned the to C: drive in windows 7 (and Vista).

    1. Open explorer and find the c:\code folder
    2. Right click on the c:\code folder and select properties
    3. select the security tab
    4. select the user ID "Users"
    5. In the permissions box, tick the "modify" allow box
    6. Select OK, OK until permision dialog boxes close

    That should resolve the permission issue

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

    For me, the windows service was running in the background. closing the service from the task manager and then rebuilding the project did the job for me.

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

    Oddly enough, I tried building an old project with Visual Studio 2010. It gave me the error that it failed due to my access being denied. I tried to remove the read-only off the directory and had no luck.

    Although, when I opened it in Visual Studio 2015, it gave me the error that my certificate was expired.

    Upon creating a new certificate and rebuilding - everything was fine.

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