views:

3325

answers:

9

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.

A: 

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.

Gabriel Isenberg
A: 

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.

Mik Kardash
+2  A: 

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.

Cory Foy
A: 

Is it possible you added the project to a location on the hard disk that is not "mapped" as part of your workspace? Double check the location of the new project

fuzzbone
A: 
  • 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.

thijs
+1  A: 

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.

Geoff Cox
+4  A: 

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

In order to restore the binding, 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.

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

Tomer Pintel
A: 

Is it possible to add projects (.csproj/.vdproj) to solution (.sln) via command line, kindly let me know, thanks.

newMe
+1  A: 

TFS sucks so bad. I spend an inordinate amount of time trying to find solutions to shit like this.

Phillip