1

I can add files and folders inside a project into the source control. (Right clicking on files/folders and selecting Source Control -> Add files to Source Control)

But I can not add the whole project into source control, but the older ones are added and a lock sign are beside them. Where is the problem? How can I add the project itself to the source control so I can see the lock sign like other ones.

enter image description here

Inside Man
  • 4,194
  • 12
  • 59
  • 119

2 Answers2

1

Go to the Team Explorer -> Source Control and manually add the files using the "Add Items to Folder" menu item.

Ankit Das
  • 640
  • 4
  • 16
1

This may occurs if your solution is not in source control or some bindings conflict when you add that project.

Please open the solution root folder with Windows Explorer to check if the new project exists in the workspace (solution root folder) first. If the project exists, then follow below steps to add the existing project in source control.

  1. Navigate to solution root in Source Control Explorer
  2. Right click in Source Control Explorer and select Add items to folder
  3. Select the Project folder you have created, then Next
  4. Select items to add or Excluded, then Finish
  5. Check in the changes

enter image description here

Another place to check is source control bindings, simply unbind and rebind the solutions/ the project or root folders in your workspace. Detail step take a look at here: Re-establish TFS source control bindings

Normally, new project will be created in the solution root folder and the files will be added in source control automatically if the solution has already been in source control. For any newly added project, just pay attention to Enabling Add to Source Control Option for New Project Dialog in Visual Studio

PatrickLu-MSFT
  • 49,478
  • 5
  • 35
  • 62