Muflix
Muflix

Reputation: 6768

The item is already under source control at selected location

How can I add a Visual Studio solution to the TFS? I created a new project named, for example, PROJECTX and I have solution with the name PROJECTX.sln. I select File > Source Control > Add Solution To Source Control, but immediately I get this error:

Source Control error; already under source control at the selected location

I also deleted and recreated the same project in TFS and my solution does not have any .vssscc files, therefore I think it wasn't in TFS before, maybe some other copy... but when I deleted the project in TFS, it should not matter, right? I tried the bind/unbind option, but it seems that I'm missing something important. Also I don't have any pending changes and the TFS project is empty on the TFS server.

If I select the Ignore All option, I cant check in the files, because it tells me it is already checked in.

Upvotes: 11

Views: 12057

Answers (6)

Russian Federation
Russian Federation

Reputation: 194

enter image description here

This is how you need to bind the solution to the server

Upvotes: 0

skoley
skoley

Reputation: 310

Close the solution . open the solution file in notepad Then remove the below section.

GlobalSection(TeamFoundationVersionControl) = preSolution
        SccNumberOfProjects = 2
        SccEnterpriseProvider = {3CF58AB4-18FA-4F8D-95D4-32DDF27D189R}
        SccTeamFoundationServer = https://serverIP/Project
        SccLocalPath0 = .
        SccProjectUniqueName1 = Ecample\\Example.csproj
        SccProjectName1 = Example
        SccLocalPath1 = Example
EndGlobalSection

then open the solution once again it should prompt to bind, do the binding properly.

Upvotes: 1

Mauricio Arias Olave
Mauricio Arias Olave

Reputation: 2575

I followed these steps:

  • If you're already in Visual Studio with the solution opened, close the solution via: File > Close solution.
  • In Source Control Explorer window, in "Folder" section (left side of the screen), navigate between your TFS projects, find and open the solution you want.
  • You'll get a message saying:

The solution you are opening is bound to the source control on the

following Team Foundation Server: your_server_folder.

Would you like to contact this server to try to enable source control integration?

Press Yes and if the connection is correct, you'll see now your solution is bind to source control.

Upvotes: -1

Jeb50
Jeb50

Reputation: 7037

I had the same. I first created a new folder in TFS, then in File Manager, copy the whole project w/o .sln file to this folder (TFS already created in file system), back in TFS, clicked on "+" icon to add everything underneath this new folder.

Then checked in for the first time.

Continued working on the project made some changes. I thought it's okay to "Add Solution to TFS", still the same problem, even though removing all .vss files/folders. Since I know TFS already has a copy, so I "Compare" it with my local version see the difference there.

So I just clicked on "Ignore All" button, Bingo, works.

Upvotes: 0

Blacketik
Blacketik

Reputation: 411

On my case, I had to correct the binding using the Change Source Control dialog box :

  • Select solution or project that you want to add to source control
  • Go to "File" -> "Source Control" -> "Advanced" -> "Change source control" (if you look at Microsoft website, you will see that there is not "Advanced" menu in their example, it may be related to VS version or menu settings).
  • Click "Bind" on each row.
  • If a row in underlined in red, it may indicate that the current project is not checked in into TFS, check-in all project before you proceed to the binding.

Microsoft - How to : Bind and Unbind Projects and Solutions

Upvotes: 27

Muflix
Muflix

Reputation: 6768

I solved this issue by copying the project folder to the new windows folder outside of local tfs workspace.

Upvotes: 0

Related Questions