Unexpected Behavior in Team Foundation Server and Visual Studio Merge Functionality

So, for one of my clients we use Team Foundation Server for our source control, overall it’s pretty good.

I am working on a project for a client and we have two versions of the application.  The new version is the one in active development but we still need to fix bugs and make some feature updates to the original version.  The new version was created by branching from the original.

Our updates to the original source tree need to be moved over and I planned to use the TFS Merge Feature.  I got ready to start my updates to the new source tree and on my first merge attempt I received this error:


Error : The merge target {0} is not mapped

I stared at the error for a bit wondering what the heck could be wrong with my source control configuration, as it’s the same as so many other developers on the project.

My usual path to problem resolution is to do a web search and if that fails then ask around the team.   The result of talking with our team of consultants resulted in it working on some systems but not on others.  The interesting thing was the difference in configuration between the have’s and have-not’s, the ones that worked were accessing both branches from the same TFS Workspace, but those that did not work had their environment broken up into two workspaces.  This was my configuration.

I started looking around at the TFS Object Model Documentation on Microsoft’s MSDN site and found the Workspace class and realized the Merge() method was on this class, which would mean, or imply, inter-Workspace merging is not supported.  Here is a snippet from the MSDN Library:


This clearly shows where the Merge() method belongs.  I changed my configuration and removed the second Workspace:


Workspace #1 looks like this:


Workspace #2 looks like this:


And the two combined into just one Workspace:


This changed worked beautifully.  I am a bit surprised you can do inter-Workspace merging or a least I could not find one.  I can now Merge easily amongst my branches.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s