Lord of Scripts
Lord of Scripts

Reputation: 3599

VS.2017 cannot add project to TFS Source Control

Visual Studio 2017 has been the crappiest so far. I have an existing solution that I want to add to source control (VisualStudioOnline.com) but every time I do it simply creates a GIT repository locally and I DO NOT want GIT. It does not even ask.

I changed the options to default to VisualStudioOnline. But when I try to add the solution I select Manage Connections, then I see the project repository I created on VSO website and click on it then Connect. After a while the window simply disappears giving no error and the Team Explorer still says I am Offline, so it was not added to TFS. My VS.2017 however is connected to my VSO account.

What is the problem here? can't they even give a hint as to why it is not connecting?

Upvotes: 8

Views: 9720

Answers (2)

MarianoC
MarianoC

Reputation: 69

Yes, it is not intuitive and I hate it too. These are the most "automated" steps:

  1. Open the solution you want to add to VSTS.
  2. Go to Team->Manage connections...
  3. You will see all your VSTS connections, I happen to use two VSTS, one from visualstudio.com and one on-premises. Choose the connection you want and right-click then select connect.
  4. Once connected, select File->Source Control->Add solution to source control...
  5. It will show up the VSTS dialog and let you choose a folder for your solution.
  6. Done.

Cheers,

MarianoC

Upvotes: 1

Marina Liu
Marina Liu

Reputation: 38106

So you want to add project to TFVC VCS not git in VSTS (visual studio team services). First you should create a TFVC repo on VSTS, then connect with VS2017, finally add the existing project in source control and check in. Detail steps as below:

  1. Create a TFVC repo by creating a new project or adding a new repo for existing project in VSTS.

    enter image description hereenter image description here

  2. Connect with VS2017.

    VS -> Team explorer -> Manage connections -> connect to project -> make sure your email for VSTS acount is selected -> select your new created TFVC repo -> connect -> Map & Get. enter image description here

    enter image description here enter image description here

  3. Add the existing project to source control.

    Copy the project file to the subfolder that you just mapped -> Team explorer -> source control explorer -> select the folder with the TFVC repo you created -> click Add Items to Folder -> select the project -> Finish.

    enter image description here

  4. Check in changes to VSTS.

    Now the project is added in source control, you can click pending changes to check in the project to VSTS.

Upvotes: 5

Related Questions