views:

1338

answers:

4

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.

+2  A: 

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

Gerrie Schenck
A: 

Before undo rename it back to old name, it will update the TFS project name. After that undo your project changes. Similar issue I had after saving current solution with other name. It's created a new solution, but in the same time it checked out the old solution in TFS, renaming it to the new one, and did not allow to undo the rename checked out. To resolve it, I loaded the new (renamed) solution, than saved it back with old name. It changed check-out solution to previous name, after that I could undo it in 2 steps:

  1. undo .sln, after that
  2. undo .vssscc

BR

+1  A: 

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.

Chris Lively
What the crap? Is this really the case?
Thomas Eyde
A: 

Me too I have problems renaming folders. For me none of the suggested approaches work. As the problem seems to be only on my client and on none of the clients of other team members it appears to be a client problem. So I renamed the local source directory and fetched everything again, didn't help. I resinstalled the TFS Client, didn't help neither.

But at least I found one way which is to close the solution first and then to check in. That's the only way for me right now to rename any folders. Does anyone have an idea why is this and how I could fix it?