Avi Mishayev
Avi Mishayev

Reputation: 21

Can't lock files in TFS eclipse

I created a tfs server by this tutorial: http://tfs.visualstudio.com/en-us/learn/connect-eclipse

after installing the plugin in my eclipse and connecting to my tfs server. whenever i tried to lock files i was getting the error: TF400022: The item XXX.java cannot be locked for checkout in workspace YYYY; Checkout locks are not supported in local workspaces.

what am i doing wrong?

thanks for the help.

Upvotes: 0

Views: 2585

Answers (2)

Hatice Altinok
Hatice Altinok

Reputation: 1

First of all, Edwards' answer gives the necessary answer to the related problem. But I had a hard time finding the part in Eclipse where I could manage the workspaces. So I wanted to show you how we convert location from local to sever in eclipse. Firstly, if you can't see the teams explorer window, you need to select Show View -> Team Explorer from the 'Window' tab. After opening Team Explorer, we double click on the TFVC Pending Changes area. Then we click on 'Actions' and click on Manage Workspaces. After clicking Edit -> Advanced in the incoming pop_up, we select the 'server' instead of 'local' in the Location part.

enter image description here

enter image description here

enter image description here

enter image description here

Upvotes: 0

Edward Thomson
Edward Thomson

Reputation: 78763

TFS 2012 introduces a new concept called local workspaces, which differ subtly from the behavior of workspaces in previous versions of TFS (the old default behavior is now called a server workspace.) Local workspaces do not require read-only files and instead allow files to be edited without checking out from the server, and they are intended to be more suitable for small to medium sized workspaces. For this reason, local workspaces are the default in TFS 2012.

Local workspaces, however, do not support locking files for check-out, since that action requires communication with the server. Thus, locking files requires a server workspace.

You can convert the workspace that you created with your VS 2012 client to a server workspace. In the Edit Workspace dialog, select Advanced, and you can change the type from a Local to a Server workspace.

Also note that since other users with local workspaces need not check-out from the server, these locks are implicitly downgraded to check-in locks for them. (If this is problematic for you policy-wise, you can disable local workspaces for the Team Project Collection entirely.)

Upvotes: 1

Related Questions