Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 454
Anthony Avatar asked Dec 30 '22 04:12

Anthony


2 Answers

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.

like image 129
NotMe Avatar answered Jan 01 '23 18:01

NotMe


If Visual Studio starts doing weird, try it directly in TFS Source Control. I had a similar problem last week.

like image 31
Gerrie Schenck Avatar answered Jan 01 '23 18:01

Gerrie Schenck