Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TFS 2010 - Deleting a folder in Visual Studio solution before check-in of changes

We are using TFS 2010 and facing a problem with deleting a folder inside of a solution in Visual Studio.

In the latest version of checked-in code, the directory in question has files in it.

One of the developers decided to move the files in that directory to another location within the solution. He then tried to delete the old folder but go the following error:

This operation cannot be completed. 
You are attempting to remove or delete a source-controlled item where the item is either exclusively locked elsewhere or otherwise unable to be deleted from source control.

Does anyone know what the problem is with trying to do this and is there a way to get around it?

like image 982
thiag0 Avatar asked May 24 '11 20:05

thiag0


People also ask

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.

How do I delete pending changes in Visual Studio?

When you want to discard any modified files/folders, right click on them under Solution Explorer. From the context menu, select Source Control | Undo Pending Changes..., as shown in the following screenshot: Make sure to double confirm whether you really want to undo the file/folder.

Can I delete $TF folder?

To answer the original question, the answer is yes. However, in order for TFS to track changes, it will need to be recreated, albeit with fewer folders and much smaller disk space. To do that: First delete all the tf$ folders currently in your current workspace folder.


1 Answers

You cannot delete a folder that has pending changes on any of its children (including if any of those children are being moved out of the folder - they're still children until that changeset is checked in.)

You'll have to do this in two steps: first, move the children out of the folder and check those changes in, then delete the folder as a separate changeset.

like image 83
Edward Thomson Avatar answered Oct 15 '22 21:10

Edward Thomson