views:

1112

answers:

6

Disclaimer: I'm stuck on TFS and I hate it.

My source control structure looks like this:

  • /dev
  • /releases
  • /branches
    • /experimental-upgrade

I branched from dev to experimental-upgrade and didn't touch it. I then did some more work in dev and merged to experimental-upgrade. Somehow TFS complained that I had changes in both source and target and I had to resolve them. I chose to "Copy item from source branch" for all 5 items.

I check out the experimental-upgrade to a local folder and try to open the main solution file in there. TFS prompts me:

"Projects have recently been added to this solution. Would you like to get them from source control?

If I say yes it does some stuff but ultimately comes back failing to load a handful of the projects. If I say no I get the same result.

Comparing my sln in both branches tells me that they are equal.

Can anyone let me know what I'm doing wrong? This should be a straightforward branch/merge operation...

TIA.


UPDATE:

I noticed that if I click "yes" on the above dialog, the projects are downloaded to the $/ root of source control... (i.e. out of the dev & branches folders)

If I open up the solution in the branch and remove the dead projects and try to re-add them (by right-clicking sln, add existing project, choose project located in the branch folder, it gives me the error...

Cannot load the project c:\sandbox\my_solution\proj1\proj1.csproj, the file has been removed or deleted. The project path I was trying to add is this: c:\sandbox\my_solution\branches\experimental-upgrade\proj1\proj1.csproj

What in the world is pointing these projects outside of their local root? The solution file is identical to the one in the dev branch, and those projects load just fine. I also looked at the vspscc and vssscc files but didn't find anything.

Ideas?

A: 

@Nick: No changes have been made to this just yet. I may have to delete it and re-branch (however you really can't fully delete in TFS)

And I have to disagree... branching is absolutely a good practice for experimental changes. Shelving is just temporary storage that will get backed up if I don't want to check in yet. But this needs to be developed while we develop real features.

Ben Scheirman
A: 

Without knowing more about your solution setup I can't be sure. But, if you have any project references that could explain it. Because you have the "experimental-upgrade" subfolder under "branches" your relative paths have changed.

This means when VS used to look for your referenced projects in ..\..\project\whatever it now has to look in ..\..\..\project\whatever. Note the extra ..\

To fix this you have to re-add your project references. I haven't found a better way. You can either remove them and re-add them, or go to the properties window and change the path to them, then reload them. Either way, you'll have to redo your references to them from any projects.

Also, check your working folders to make sure that it didn't download any of your projects into the wrong folders. This can happen sometimes...

Kevin Berridge
+1  A: 

@Ben

You can actually do a full delete in TFS, but it is highly not recommended unless you know what you are doing. You have to do it from the command line with the command tf destroy

tf destroy [/keephistory] itemspec1 [;versionspec]
           [itemspec2...itemspecN] [/stopat:versionspec] [/preview]
           [/startcleanup] [/noprompt]

Versionspec:
    Date/Time         Dmm/dd/yyyy
                      or any .Net Framework-supported format
                      or any of the date formats of the local machine
    Changeset number  Cnnnnnn
    Label             Llabelname
    Latest version    T
    Workspace         Wworkspacename;workspaceowner

Just before you do this make sure you try it out with the /preview. Also everybody has their own methodology for branching. Mine is to branch releases, and do all development in the development or root folder. Also it sounded like branching worked fine for you, just the solution file was screwed up, which may be because of a binding issue and the vssss file.

Nick Berardi
A: 

Hi Ben,

A couple of things. Are the folder structures the same? Can you delete and readd the project references successfully?

If you create a solution and then manually add all of the projects, does that work. (That may not be feasable - we have solutions with over a hundred projects).

One other thing (and it may be silly) - after you did the branch, did you commit it? I'm wondering if you branched and didn't check it in, and then merged, and then when you tried to check-in then, TFS was mighty confused.

Cory Foy
A: 

@Kevin:

This means when VS used to look for your referenced projects in ....\project\whatever it now has to look in ......\project\whatever. Note the extra ..\

You may be on to something here, however it doesn't explain why some projects load and others do not. I haven't found a correlation between them yet.

I think I'll try to re-add the projects and see if that works.

Ben Scheirman
A: 

@Cory:

I think that's what I'm going to try... I have about 20 projects and 8 or so aren't loading. The folder structures are identical from root... ie: there aren't any references outside of DEV.

Ben Scheirman