TFS won't allow folder rename, claims that there are locks

Anthony picture Anthony · Feb 23, 2009 · Viewed 7.5k times · Source

In visual studio 2008, I want to rename a folder due to a typo in the name. I rename it in the solution structure. The folder and .CSProj files are now checked out, and I check in.

TFS comes back with "Microsoft Visual studio cannot perform the source control operation at this time because some of the files involved in the operation are locked. Please retry the operation at a later time".

Looking in the Source control explorer, I can confirm that the folder and the files in it are not checked out at all. The .csproj and csproj.vspscc are "edit" by one other user.

What's going on here?

If I try to undo the change, I get the same message. I have to force get the latest version before I can undo the changes. What's up with that too?

The eventual fix was to get all other users to check in the .csproj, then rename folders in Source control explorer. At this point it worked, though the same hadn't worked before.

Check-in of the rename succeeded, and references to the old names were cleaned up in following checkins.

Answer

NotMe picture NotMe · Mar 19, 2009

If one of the files in the folder you are renaming is checked out, then TFS can't move the file to the new location.

For any folder renaming action, everyone has to be out of the project.