Simon
Simon

Reputation: 1507

How to add TFS bindings to a Visual Studio 2010 project?

There's a question already discussing how to add project/solution bindings to TFS, however it seems to only apply to Visual Studio 2008 (I am unable to find the "Change Source Control" dialog in VS2010).

I have a solution and source code on my local machine already in TFS, however it does not have TFS bindings (the thing that produces the padlock icon in the Visual Studio Solution Explorer and allows automatic checkout).

How can I add bindings to an existing TFS project using Visual Studio 2010?

Upvotes: 10

Views: 14409

Answers (4)

Ben Schwehn
Ben Schwehn

Reputation: 4565

I had the same problem and the following steps solved it for me in VS 2008.

Unfortunately, I didn't record the exact steps and don't want to add a new project to our TFS to try again, so the steps are from memory.

  1. Go to File Menu -> Source Control -> Open from source control
  2. Select solution file from TFS hierarchy
  3. Accept any warning about project already being on local disc
  4. A popup dialog comes up saying something along the lines "This solution is already under source control, but no bindings exist. Do you want to add them?"
  5. A selector shows all projects in a grid and allows adding the required bindings. Add TFS server setting to each project (select all lines in grid at once and press a button at the top. I can't remember what it was called, but it was fairly obvious).

Upvotes: 0

PatrickV
PatrickV

Reputation: 2135

I ran into this problem and, for me, the issue was that my solution was offline with respect to TFS. Upon trying to change source control, I received a message stating that it is already associated with source control but is offline. I placed the solution on-line, per my recollection, using the File->Source Control->Go Online menu option and this seemed to fix the problem.

Upvotes: 2

Gern Blanston
Gern Blanston

Reputation: 42660

In VS2010 check Tools>Options>Source Control and see if set to TFS. If not that might be why you don't see File->Source Control->Change Source Control.

Upvotes: 6

Ryan Hayes
Ryan Hayes

Reputation: 5310

Go to the source control explorer under Team Explorer, where you can see your repository. Right click on the top folder that maps to the folder on your local machine. There's an option called "Map to local folder". Map this to the folder on your local machine. This will set up all the bindings for TFS for your project.

Upvotes: 0

Related Questions