VS.2017 cannot add project to TFS Source Control

Lord of Scripts picture Lord of Scripts · Jun 19, 2017 · Viewed 8.5k times · Source

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?

Answer

Marina Liu picture Marina Liu · Jun 20, 2017

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.