How to unshelve another developer’s changes that include dlls or other binaries

dllnugettfsunshelve

Using Team Foundation Server 2010 I am trying to unshelve a series of changes made by another developer on my team. This shelve set includes some Nuget packages which include dlls. I am receiving multiple errors along the lines of:

The item $/file/path/some.dll is locked for check-out by USER in workspace MACHINENAME.

In 2008 Mac Noland asserted in his blog post Unshelving files that have File Merging disabled that this error is caused by having file merging being disabled. Which makes good sense to have file merges disabled for binaries. Based on the error I am assuming that TFS 2010 is still utilizing the merge utility when unshelving (makes sense as to why). That said I do not want to enable file merging for dll files.

Unfortunately, understanding what is going on and fixing it are two different things. In TFS is there a way to unshelve binary files which were shelved by a different user?

Best Answer

If the user created the shelveset, but left everything checked out locally, you will receive this error. Since TFS usually allows only a single checkout for binary files, a shelveset can't be unshelved if it contains a binary file which is locked by another user.

You can attempt to unlock the file with the following command -

tf lock itemspec /lock:none /workspace:OtherUsersWorkspace

You should be able to determine the workspace from the error message, and you'll also need to specify the user - /workspace:WORKSPACE;userid