locked
proper way to delete tfs-controlled folders and sync with local? RRS feed

  • Question

  • Hello - What's the easiest way to delete folders from a TFS-controlled project?  If I try to delete the folders directly from the project after they've been checked into TFS as part of the sln then I get an error that says something to the fact that the folders can't be deleted because they're in TFS.

    If I go into TFS and delete the folder directly from TFS then there's a red X to the left side of the folder - the folder doesn't actually get visibly removed.  If I right click the folder and select the check-in option then this visibly removes the folder from TFS. 

    However, if I do a full get on the sln in my local environment then the folders don't get removed.  Even if I delete all of the contents from the project folder and then do a full get from TFS the folders are added back to my local project.  Even if I close the solution in my local environment and then double-click the sln file in TFS then the solution gets opened in my local environment with the 2 deleted folders still there.

    I think I could do an unmap/remap which I think might fix the issue but this can be time-consuming and risky for nested solutions.  Furthermore, this amount of work seems unnecessary to simply delete 2 folders.

    I'm guessing that there must be a way to properly delete TFS-controlled folders from a project other than unmap/remap.  Please reply if you have the solution to this.  I've got to think there has to be a better way than a full unmap/remap?


    Monday, November 5, 2012 6:38 PM

Answers

  • It's always lots of fuzz when people have files check-out and deleting files locally in their workspace. This should not be done.

    I recommend you to download the TFS Power Tool package, and use the "Find In Source Control"  feature to track down any files that is check-out, but missing in any local workspace. From the Power Tools you can undo the check-out and delete it in a normal manner.

    TFS 2010 Power Tool:
    http://visualstudiogallery.msdn.microsoft.com/c255a1e4-04ba-4f68-8f4e-cd473d6b971f


    Roar Jørstad aka sveroa
    Senior Consultant, EVRY as
    Blog: Notebook, trick & tips
    Please mark as answer or helpful if my post is useful

    Wednesday, November 7, 2012 10:38 AM

All replies

  • If you have added folder in the "Source Control" and check-in changed. The best way to remove a folder from the "Source Control" AND local workspace folder, is to right-click the folder in "Source control" and select "Delete" followed by a "Check-in changes".

    If you delete det local folder without deleting it from "Source Control", the folder(s) will reappear when a "get latest" is perfomed on the folder or parent folder for the given team project.


    Roar Jørstad aka sveroa
    Senior Consultant, EVRY as
    Blog: Notebook, trick & tips
    Please mark as answer or helpful if my post is useful

    Tuesday, November 6, 2012 12:39 PM
  • I followed those steps and the folders no longer exist in TFS. However, when I try to delete those folders from my local sln the following source control error dialog is displayed:

    "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."

    The folders no longer exist in TFS after deleting the folders in TFS and checking in the changes so I'm really not sure why I'm getting this error message when trying to delete the folders from my local solution. "Get Latest" doesn't fix this issue either....

    Tuesday, November 6, 2012 11:02 PM
  • I even selected the "Open Folder in Windows Explorer" option from App_Data where the subfolders were located.

    I deleted the folders from Windows Explorer and closed and reopened the solution. The deleted App_Data subfolders are still there.

    How do I get rid of these folders from my solution once and for all without having to unmap/remap?

    Tuesday, November 6, 2012 11:08 PM
  • It's always lots of fuzz when people have files check-out and deleting files locally in their workspace. This should not be done.

    I recommend you to download the TFS Power Tool package, and use the "Find In Source Control"  feature to track down any files that is check-out, but missing in any local workspace. From the Power Tools you can undo the check-out and delete it in a normal manner.

    TFS 2010 Power Tool:
    http://visualstudiogallery.msdn.microsoft.com/c255a1e4-04ba-4f68-8f4e-cd473d6b971f


    Roar Jørstad aka sveroa
    Senior Consultant, EVRY as
    Blog: Notebook, trick & tips
    Please mark as answer or helpful if my post is useful

    Wednesday, November 7, 2012 10:38 AM