views:

176

answers:

1

My team is taking over a project from a previous team. We use a different TFS server than the original team, and we are also not interested in keeping the history of the project because we are accepting the latest version of the code as the beginning of our history with the project. Branching is not an option since we want to start our history from the current version of the code. We just want a fresh project with the existing code.

I have not been able to create the new project from the old code successfully. I keep getting an error: "Source control cannot add the solution: Solution would span multiple workspaces"

My process for attempting the new project creation:

  1. Create a workspace for the previous team's version of the code.
  2. Get latest version of that code into local mapped workspace directory
  3. Open the solution.
  4. Unbind all projects and solution.
  5. Close solution.
  6. Create a workspace for the new version of the code on our TFS server.
  7. Copy the unbound code on my local box to the new local workspace mapped folder.
  8. Open the solution from the new directory.
  9. "Add to source control" from the new solution.

Then I get the error. I have tried removing the TFS security files out of the code directories in the unbound version and tried changing source control instead of adding to source control (but it just binds back to the original instead of letting me bind to the new).

Is there any other way to do this besides recreating the solution/projects and adding back all the files and references? It doesn't seem like it should be this difficult...

Any advice much appreciated!

A: 

Your way should work...there's probably some minor discrepancy in your steps or your initial state that I'm misinterpreting. Rather than debug to death, let's abandon what you've got so far and do this instead:

  1. Fetch the previous team's code onto your machine somehow. Preferably just a straight robocopy from a colleague or the old build server; no TFS connections. If you do have any workspaces associated with the old TFS, delete them now.
  2. Unplug from the network, or otherwise ensure the old TFS is not reachable.
  3. Open the solution.
  4. You'll be prompted: "work offline" or "permanently remove bindings"? Choose the latter.
  5. File -> Save All.
  6. Reconnect to the network.
  7. Create a workspace that maps a superset of the code dirs to some path on the new TFS.
  8. Solution Explorer -> rightclick root node -> "Add to source control."

Per the rules I describe on my blog, step 8 should succeed w/o user intervention (no "browse for folder" dialog, no error popups).

Note: steps 2-4 assume you have VS 2008. If you have 2005 you'll have to manually poke around in the Bind dialog.

Richard Berg
Thanks for your response Richard. I finally got it working almost the way I started. Put details in comment on the OP.
Lindsay