22
votes

I added a new project to a Solution Folder in VS2013. I added the project to TFS via Source Control Explorer but in VS Solution Explorer the little lock icon next to the project is not displayed. I just downloaded the solution to a new computer, and that project did not get downloaded. I had to go into Source Control Explorer and explicitly get it. The solution just does not recognize it as under source control...

How do I correct this?

Any help is appreciated

5

5 Answers

36
votes

You probably need to bind the project to source control.

  • Open the project in Visual Studio.
  • File > Source Control > Advanced > Change Source Control (or you might find there is only an option like File > Source Control > Add to Source Control - I can't remember exactly what this looks like)
  • If you get to the Change Source Control dialog, then select all the projects in the list and click Bind. If this works you should have a tick in the "Connected" column and "Valid" status, and you can OK the dialog and your project should be good to go. If binding fails, then Unbind everything and try binding again.
5
votes

Looking back to basics, I discovered some of the files (such as the project file itself) had never been added to source control. I discovered this by going to Source Control Explorer, selecting one of the projects unmarked in Solution Explorer, right-clicking to get the context menu, then selecting Add Files To Source Control, then selecting the whole list presented, then clicking OK/NEXT/FINISH. That marked the unmarked project in Solution Explorer with a plus sign (+) to be added. Then again from Source Control Explorer I selected the solution and clicked Check In Pending Changes. Then I got the lock icon in Solution Explorer.

0
votes

If the Projects/Folders are missing in Source Control this can be done -

Open TFS -> Source Control Explorer -> Right click on Solution folder and click 'Add Items to Folder...'. Now in 'Add to source Control' prompt select the folder of desired project that needs to be added to source control. On doing so the project folder along with its content should appear with + sign and on check-in the project will be available under the solution in source control.

0
votes

This is the reason due to solution is available on TFS but local instance is not bound to server directory. Solution: Files=>Source Control=>Advanced=>Change Source Control Then Bind all projects to server repository location.

This will resolve the issue.

0
votes

Compare with another correct project,I know it's lost xxxx.csproj.vspscc file for my project.

for init this file.

First , you should open right project and add error project in current solution.

Then,Right click error project click Source ContorlAdd Item to source control

enter image description here

Then, source control will warn you

Click Continue

enter image description here

Source control warns you again to rebind item

you shoud click Ignore All

enter image description here

After check out and check in error project,It will be ok.