TFS 2012 Unshelve to different branch -> An item with the same key has already been added

Scott Nimrod picture Scott Nimrod · Aug 16, 2012 · Viewed 9k times · Source

I need help resolving the following issue:

I am attempting to unshelve code from the source branch onto a target branch.

I am using the following:

  • VS2012 RC
  • TFS 2012
  • VS2012 x64 Cross Tools Command Prompt

When I use the command prompt to perform the unshelve operation, the following occurs:

  1. Shelveset details dialog gets displayed with list of change files.
  2. Click Unshelve button.
  3. Observe command prompt output: "An item with the same key has already been added."

I have downloaded ServicePack1 for power tools. However, I have failed to resolve this issue.

Answer

idlemind picture idlemind · May 15, 2013

I had the same issue and fixed it when I re-shelved the changeset from the source branch but chose not to preserve pending changes locally. After this the migration of the new shelveset ran smoothly.

(I also made sure I'd followed the below steps collected from other answers on this site)

  • Use a workspace that encompasses both source and target branches
  • Run the command from the folder mapped to the source branch
  • Check for quotes around any paths containing spaces
  • Deleting the cache in C:\Users[USERNAME]\AppData\Local\Microsoft\Team Foundation\4.0\Cache and restarting Visual Studio