Question

I have some 3rd party dlls checked into TFS
Our machines were renamed and now TFS believes they are checked out for edit by me on another machine.

I tried tf lock /lock:none contrib64/* /workspace:oldmachine;myusername but I get the error

TF10152: The item $/XXX/YYYY/contrib64/third_party.dll must remain locked because its file type prevents multiple check-outs.

1, Is there any way around this ?
2, Is TFS really this bad or is it just me ?
3, Is the purpose of TFS to make us nostalgic for VSS?

ps It's a hosted version so I can't just get the admin to fix it.

Was it helpful?

Solution

Undoing the lock won't work on those files because they are binary, as binaries cannot be merged they must be locked if they are checked out.

As the machine the workspace resides on no longer exists (the machine has been renamed) the best thing to do is delete the workspace.

from a Visual Studio command prompt

tf workspace /delete oldmachine;myusername /collection:http://*tfsserver*:8080/tfs/*collection*

This will remove the workspace and undo all pending changes

OTHER TIPS

If you don't want to delete the workspace, you can undo the change and unlock the file after that:

Using a Visual Studio developer command prompt:

tf undo "$/<server-path-to-file/folder>" /workspace:"<workspace>;<user>" /collection:<collection-url> /recursive

tf lock "$/<server-path-to-file/folder>" /lock:none /workspace:"<workspace>;<user>" /collection:<collection-url> /recursive

Files with .dll extension as well as other extensions like .exe, .doc, .docx, etc. are automatically locked because (as mentioned) here they cannot be merged.

If you want to disable the automatic lock and allow these files to go through gated check-in, follow the steps below:

  1. Log in to your build server.
  2. Open visual studio.
  3. In team explorer, log into your team project.
  4. Go to "Settings".
  5. Under "Team Project Collection", select "Source Control".
  6. Set "File Merging" property to "Disabled" for any file extension you don't want to be automatically locked.

Reference: https://blogs.msdn.microsoft.com/phkelley/2008/11/12/everything-you-ever-wanted-to-know-about-locks/

This worked for me.

I needed to change settings in 2 places:

  1. At Visual Studio, team project window, Settings->Team Project Collection -> Source Control enter image description here Enable File Merging for the extension.

2) At Visual Studio, team project window, Settings->Team Project -> Source Control enter image description here Enable the multiple check-out box

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top