Re-establish TFS source control bindings
You say you've tried undoing the binding, but have you tried rebinding back to source control?
In Visual Studio:
- Open a solution with the problem
- Choose the solution in Solution Explorer
- Pick File->Source Control->Change Source Control
Visual Studio 2013/2015: File->Source Control->Advanced->Change Source Control - Unbind any projects that are bound but not working correctly.
- Bind all projects that are now unbound.
I agree with Joel - usually unbinding and rebinding fixes it.
However, if rebinding doesn't work, you might try editing the solution files directly. I have seen instances where TFS bindings are in the solution file twice and appear to be inaccurate for whatever reason - They may have the wrong number of projects and projects that are set to nothing but still listed in the solution file.
When this happens (pretty rare) I edit the files and make them the way that they should be. For example, I will delete out the 2nd set of TFS bindings (GlobalSection(TeamFoundationVersionControl) or fix any other discrepancies that I see. Then I reload the solution and that normally fixes the problem. I would definitely only use that fix as a last resort though.
I saw this problem the first time I opened an existing (and previously working) solution in a newly installed Visual Studio, with a newly made Workspace.
Unbinding and rebinding didn't fix the problem for me. But it went away when I did a Get Latest Version. TFS showed the files as conflicted, and I resolved the conflicts by overriding the local copy. The previously invalid bindings were then shown as valid.
When you have an invalid binding and unbinding/binding a project doesn't work, try the following:
- Unbind project in Change Source Control
- Unload project in Solution Explorer (For a website-project 'unload project' is not in the context-menu but in the 'Website' menu)
- Reload project in Solution Explorer
Works for me all the time...