Trying to reattach a new machine to all of the dependencies my project has, my current hurdle is the TFS bindings. I see this:
...when I select File | Source Control | Change Source Control..., but the values in the cells are read-only. When I mash the "Bind" button, I'm scolded with, "The mappings for the solution could not be found". Yeah, I know, that's why I want to rebind them. How?
UPDATE
Selecting File | Source Control | Workspaces, I get a list of workspaces (but only after I select the "show remote workspaces" checkbox), and the one I'm currently interested in looks fine to me:
...so what's wrong with this? I'm assuming the "$\tlog" is connected to the remote source; and the source on my local machine is where the "local" cell indicates, so...what's the problem? Why won't it let me re-introduce the pair to each other?
UPDATE 2
On restarting, I was getting, "The associated source control plug-in is not installed or could not be initialized. Common causes for this error include server unavailability and/or incorrect workspace mappings." and based on an answer here: How do I get Visual Studio Team Foundation Server to see I moved code to a different folder?, I allowed it to "permanently unbind." But when I look in the Workspaces, the setup is exactly the same as it was: the connections are exactly the same as before (it's true, they don't work, but I would think permanently unbinding would remove them from Workspaces).
UPDATE 3
Another restart of Visual Studio, and the bindings do appear to be severed - no more err msg. However, they still show as being connected in Workspaces!?!
UPDATE 4
I can now edit the "Change" dialog, but even though the connections seem accurate, it's telling me the status is invalid:
I know the local path is correct, and I can't do anything (AFAIK) about the server path (and I'm sure that hasn't changed), so why is it invalid? Gotta love this "productivity" software.
UPDATE 5
I tried that. I removed everything from the "GlobalSection(TeamFoundationVersionControl)" section, selected File | Source Control | Change Source Control..., then with the first of the projects in the solution highlighted, selected the "Bind" button. It went from this:
...to this after mashing the "Bind" button:
IOW, still no joy in Mudville (Casey has struck out). It says it has connected, but that it's invalid. It would be nice if it would explain why - what is invalid about it? Give me a clue, TFS!
UPDATE 6
Well, I did get a little further and got some of the projects to bind:
Yet nine remained incalcitrant. I tried to fix those bindings by altering the .sln file. As mentioned, nine projects in the solution had a status of "Invalid" and the rest (over twice the number) were "Valid"
So I compared the valid with the in-, and I saw that all the "invalid"s had additional path "descriptions" such as "../../" and "..\" etc. So, I stripped all those out, replaced the .sln with that, and ... nothing. The invalids stayed invalid.
I then took the "nuclear option" suggested by DaveShaw here: TFS Issue: No source control options (get latest, check-out, check-in) for Solution
...but still no go - no change; the valid remained valid, the invalid remained invalid.
I could have rewritten all the code in the time this TFS nonsense is taking!
Not really, but it's still quite frustrating.
UPDATE 7
For more specifics on just what I've tried and what is happening, see http://social.msdn.microsoft.com/Forums/vstudio/en-US/08d3e956-62a8-4874-8468-f178d12ac67c/why-is-the-requested-url-and-physical-path-the-browser-is-trying-to-use-different-from-the-actual?prof=required
UPDATE 8
It seems to me that what TFS should do is allow you to provide it with a local folder structure, or better yet one that has no subfolders, just the "starting point" and then TFS should fill out the folder structure based on the repository's structure, and populate that with the latest code.
If that is how it works, or can work...gr8! But I haven't been able to find out how to do that yet...
UPDATE 9
Here's the way I think it should work:
1) In Windows Explorer, you create a local folder, naming it appropriately for your solution
2) You open Visual Studio, and select "Connect to TFS" on the Visual Studio Start Page
3) You select File | Source Control | Workspaces... | Edit...
4) On the record/row in the Working folders part of the "Edit Workspace " dialog, you click into the "Local Folder" entry so as to be able to edit it
5) You mash the ellipsis button to bring up the Folder dialog.
6) You then select the folder you created in step 1 and mash the "Ok" button.
You now have a record in the "Working folders:" section that looks like this
Status Source Control Folder Local Folder
===== ================== ==========
Active $/Whatever C:\Whatever
7) You now mash this "OK" button
Note: When I do this, I get a dialog that says:
"Workspace Modified One or more working folders in version control have changed. Do you want to get the latest files from version control to update your local workspace?"
I mashed "Yes" and saw:
"Get Progress C:\Whatever\\\..."
...and the progress bar's continually updated text seemed to indicate that it was doing what I would expect (copying the repository files to the local folder, creating subfolders as necessary).
8) You mash the "Close" button on the "Edit Workspace " dialog
9) You then select "Open Project..." on the Visual Studio Start Page, and navigate to C:\Whatever
10) The sun comes out, bluebirds begin to sing, and dolphins begin jumping out of the water in the middle distance in a choreographed display of delight.
However, in my case what happens is that Windows Explorer says the object of my desire (Whatever.sln) is found in two local folders, but clicking on those folders shows no such file. There is one, but it's not where Windows Explorer says it is...it's another folder below that. And when I select that project to open, I get:
"The Web project is currently configured to use the URL 'http://localhost/<different one>
'. the Web server has this URL mapped to a different folder 'C:\Project\ccr\TLog\Development\Development\Externals\CommonLogin.' Would you like to remap this URL to point to this Web project's folder?"
I say "Yes"
I get the same message for another project, and again select the "Yes" button.
The project loads. It seems to be the right collection of projects in the solution.
Perhaps it really has worked this time (after a fashion). What I mean by that qualification is that, when I compile the solution, Visual Studio tells me there are 11251 Errors... perhaps it's a matter of adding references and whatnot. I did get this: "One or more projects in the solution were not loaded correctly. Please see the Output Window for details."
At any rate, instead of basking in the sun listening to the bluebird of happiness, the sedge has withered from the lake, and no birds sing.
UPDATE 10
I finally got it to work, by following Jason Williams' answer; however, I still have 11,257 error messages due to broken references. Is there a way to automate the process of fixing these, or must I slog through them one assembly at a time (I know some will fix more than 1 err msg, but still...)
UPDATE 11
Here's what the erstwhile Sacramento King was talking about re: "Get Specific Version" (see the comments following his answer):