Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio Publish Failed: "Unable to delete file ... Access to the path ... is denied."

Tags:

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 thousand errors like this:

Unable to delete file "obj\Debug\Package\PackageTmp\Views\ViewName.svn\text-base\ActionName.aspx.svn-base". Access to the path 'C:\Code\SolutionName\ProjectName\obj\Debug\Package\PackageTmp\Views\ViewName.svn\text-base\ActionName.aspx.svn-base' is denied.

Visual Studio: "Publish failed"

Why is Subversion giving me trouble? How do I fix it?


I disabled the file indexing of my bin and obj folders. But, that didn't work.

Allow files in this folder to have contents indexed in addition to file properties

like image 555
Zack Peterson Avatar asked Sep 02 '10 14:09

Zack Peterson


People also ask

How do you fix Cannot delete file access is denied?

To work around this issue, use either of the following methods: When you delete the files or folders by using Windows Explorer, use the SHIFT+DELETE key combination. This bypasses the Recycle Bin. Open a command prompt window and then use the rd /s /q command to delete the files or folders.

How do I delete a folder in Visual Studio?

In either Solution Explorer or Source Control Explorer, browse to the folder or file that you want to delete. Select the items that you want to delete, open their context menu (right-click), and choose Delete.


2 Answers

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

It worked! Publish succeeded.

Folder Properties Read-only

like image 82
Zack Peterson Avatar answered Sep 18 '22 14:09

Zack Peterson


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

like image 36
Dee Avatar answered Sep 22 '22 14:09

Dee