10
votes

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?

4
I just checked my VS2010 and I have File->Source Control->Change Source Control as per the SO question you referenced.Gern Blanston

4 Answers

6
votes

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.

2
votes

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.

0
votes

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.

0
votes

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).