22

I have a Visual Studio online Team Project with a repository. I have been using this with VS 2013 for a while now.

I installed VS 2015 and connected to Visual Studio online in team explorer and chose the project in question.

however, under solutions it says:

You must clone the repository to open solutions for this project.

I did go to settings and edit my global settings to set my repository root correctly. (same location as set in Visual Studio 2013)

But, it is already cloned and on my local machine.

Why isn't VS 2015 Team Explorer seeing the existing repository folder? How can I fix this other than deleting the folder and doing clone again?

Daniel Mann
  • 57,011
  • 13
  • 100
  • 120
PilotBob
  • 3,107
  • 7
  • 35
  • 52

5 Answers5

28

Because Visual Studio 2013 maintains a list of the repositories that it's seen (and their remotes) separately from where VS 2015 stores this information.

Open Team Explorer, go to the Connect page, and in the Local Git Repositories section, click the Add button. Navigate to the repository that you cloned previously.

Since you're connected to the server, VS will realize that the repository you just opened is a clone of a repository in your server and enable the TFS functionality.

Edward Thomson
  • 74,857
  • 14
  • 158
  • 187
  • 3
    Sadly, I only get "No new repositories were found" in this scenario on VS15 – Thomas Hagström Nov 22 '15 at 19:00
  • 4
    I had the same message. The solution was to right click the repository in the list of Local Repositories and remove it. Then follow the steps that Edward described again. – Frederic Feb 12 '16 at 12:31
  • 1
    I also get "No new repositories were found", and my local repository list is empty. – Ivy Mar 14 '16 at 17:07
  • 2
    For me it doesn't work to remove the local repository and add it again. For me it worked to goto tfs-connection and remove the projects and then reconnect to tfs. After this the remote and local repositories were connected again. – steininger Jul 03 '16 at 22:22
  • 1
    This didn't work for me, **until** I changed the name of the Visual Studio Online remote to **"origin"**. It seems it didn't like having multiple remotes and not being the default remote. – Grhm Aug 05 '16 at 14:40
  • @Grhm Interesting - I didn't know about that limitation! – Edward Thomson Aug 05 '16 at 15:05
  • 1
    Also note, the requirement for VS associating a repo with a TFS/VSTS connection is that the origin url match the connection url. So don't mix and match short and FQDN. I would recommend just using FQDN for the server connection and for anything you clone manually, that way getting them linked is much easier / possible. – Mike Fourie Aug 24 '16 at 21:27
1

At least for Visual Studio 2017 and Visual Studio Team Services:

If you have several repositories in your Team Foundation Server or VSTS project make sure you are connected to the specific repo your clone is for, not just the project. You can then enter the location at the bottom of the "Connect to Project" dialog or just add it as described in the other answer.

user1568891
  • 386
  • 6
  • 12
0

Or just close VS, then navigate to the directory that you have cloned and open the solution in your newer Visual studio.

You will see VS changes "applicationhost.config" file, and then remembers that it was cloned

Ruan
  • 3,969
  • 10
  • 60
  • 87
0

I suddenly had the same problem. VS2015 didn't longer recognize, that one of the local repos is a clone and I should make a new clone to "[ProjName]2"...

For me it helped to reconnect to the remote Team Project:

  1. Open the local repository solution
  2. Go to the connection manager ("Manage Connections")
  3. Uncheck the remote project ("Team Projects")
  4. Close Window by click on Connect
  5. Reopen the Connection Manager
  6. Check the Team Project again and "Connect"

and everything was fine again!

Oliver
  • 11
  • 3
0

For anyone coming here from VS2022, I got this issue because I had the remote repo URL mismatched. I used the fully qualified domain name, but Team Explorer was connected to the server using merely the domain name. The hint was when I tried cloning the repo even though it was already cloned, and saw the different URL. Changed my local repo's remote URL to match, and then I was able to connect in Team Explorer correctly.

Bondolin
  • 2,793
  • 7
  • 34
  • 62