Adding a new project to an existing solution in TFS

Visual StudioTfs

Visual Studio Problem Overview


I added a project to an existing solution that is currently under source control using TFS, but for some reason I cannot check in the new project. When I view my pending changes, none of the files in the new project show up. None of the files have a plus (for a new file) next to them. What did I do wrong? How do I fix it? It's time to check in.

Visual Studio Solutions


Solution 1 - Visual Studio

The problem is the solution has lost its binding. That's why it's not checking out automatically when you add the new project.

In order to restore the binding in VS 2010, go to File->Source Control->Change Source Control. Look for the "Solution: your solution name" and if it's not bound it will say "no server". Click on it and then click "Bind" from the toolbar.

in Visual Studio 2012/2013 it's File->Source Control->Advanced->Change Source Control (Thanks to danglund).

This should create a new vssscc file that is correctly bound. Now add the new project and everything should work correctly.

Solution 2 - Visual Studio

I was also having the same problem, this is how I fixed it:

Go to Visual Studion: File->Source Control->Change Source Control Find your project there, its status would be "Invalid", Click on it and press "Unbind". Now go back to Solution Explorer and Remove your project. Add this project again into the solution explorer solve the problem.

Good Luck!

Solution 3 - Visual Studio

  1. Click on the Team Project name in Source Control Explorer
  2. File -> Source Control -> Add Items to Folder...
  3. Follow the wizard.

Solution 4 - Visual Studio

Head over to Source Control Explorer and browse to the place in the tree which matches where the new project is at for your solution. Add the files there.

However, I'd be concerned that you modified the solution file and it didn't ask you to check that out. What you may want to try doing is manually checking out the solution file, then readding the project to the solution and seeing if it takes then.

You shouldn't need to drop to the command line - this is a pretty straightforward operation.

Solution 5 - Visual Studio

Open the solution. Select the project (make sure it is in the solution).

File -> Source Control -> Properties will bring up the binding dialog.

Bind the project to source control.

You should now see + signs next to all your files. The key is that that a .vssscc is added for your project to version control.

If that fails, open your csproj in notepad (after making a backup), and ensure any version control bindings are removed, then try again.

Solution 6 - Visual Studio

Unfortunately, I'd wager that your best bet is to manually do the check-ins through the command line. I've ran into situations where the Team Explorer UI grows out of sync with what's actually happening in source control, and manually fixing things through tf.exe was the only way to resolve it.

That said, normally, adding a new project to a solution isn't a hassle.

Solution 7 - Visual Studio

TFS can simply do not know about your project existed. Just add your project files through Source Control Explorer and re-load the solution.

While loading of a solution it can ask you to bind your project to source control. Let it do so by clicking Bind button - it should do all the magic for you.

Solution 8 - Visual Studio

  • Make sure you get the latest version of the solution
  • Check out the solution file
  • Add the new project

If the newly added project was previously under (another) source control, that might mess things up, make sure to "unbind" it before adding it. (See source control bindings somewhere under the "file" menu in Visual Studio)

You shouldn't need the command line.

Solution 9 - Visual Studio

I had this same problem in VS 2019, where I had added a new project to an existing solution, and the project wasn't showing up in pending changes. Right-clicking on the project and going to Source Control only had an option to "Add Solution to Source Control".

Using the above answers, I started down the File --> Source Control path, which then yielded an option to directly "Add selected projects to source control". Taking that option solved the problem, so that now the new project shows up in pending changes. NOTE: I'm adding this answer since it's still an issue in VS 2019, but has an easier solution now than in the past.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
Questioncoder1View Question on Stackoverflow
Solution 1 - Visual StudioTomer PintelView Answer on Stackoverflow
Solution 2 - Visual StudioEdgeView Answer on Stackoverflow
Solution 3 - Visual Studiothiag0View Answer on Stackoverflow
Solution 4 - Visual StudioCory FoyView Answer on Stackoverflow
Solution 5 - Visual StudioGeoff CoxView Answer on Stackoverflow
Solution 6 - Visual StudioGabriel IsenbergView Answer on Stackoverflow
Solution 7 - Visual StudioMik KardashView Answer on Stackoverflow
Solution 8 - Visual StudiothijsView Answer on Stackoverflow
Solution 9 - Visual StudioBeckySView Answer on Stackoverflow