none
Error: An item with the same key has already been added

    Question

  • We are getting "An item with the same key has already been added" error during a merge operation. However, there is no detail on what this item is and what we can do to resolve it. Any suggetions on how to approach this?

    Monday, September 15, 2008 3:35 PM

Answers

  • Hello BillyM 2005,

     

       Could you please delete client caches to see if it works?

     

      1) Create a file named "tfscacheclean.cmd"
    2) Copy and paste:

    @echo off
    REM clean up most TFS cache files on current machine

    SETLOCAL

    @echo =====Cache Cleanup=====

    SET LOCALAPPDATA=%HOMEDRIVE%%HOMEPATH%\Local Settings\Application Data

    @echo Deleting the new common TF client cache directory (1.0)...
    if exist "%LOCALAPPDATA%\Microsoft\Team Foundation\1.0\Cache"  rd /s /q "%LOCALAPPDATA%\Microsoft\Team Foundation\1.0\Cache" > nul

    @echo Deleting the new common TF client cache directory (2.0)...
    if exist "%LOCALAPPDATA%\Microsoft\Team Foundation\2.0\Cache"  rd /s /q "%LOCALAPPDATA%\Microsoft\Team Foundation\2.0\Cache" > nul

    @echo Deleting Team Explorer cache files...
    if exist "%APPDATA%\microsoft\visualstudio\8.0\Team Explorer\."   rd /s /q "%APPDATA%\microsoft\visualstudio\8.0\Team Explorer" > nul
    if exist "%APPDATA%\microsoft\visualstudio\9.0\Team Explorer\."   rd /s /q "%APPDATA%\microsoft\visualstudio\9.0\Team Explorer" > nul

    ENDLOCAL

    :end

    3) Save
    4) Make sure any instances of Visual Studio are not running.
    5) Run script.

      From http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2876392&SiteID=1

     

      Do you use TFS 2005?

     

       As I know there is an issue at Source Control Explorer 2005,

     

       You can try to apply SP1 of 2005.

     

      If you are using TFS 2008.

     

       There is a similar issue, it will be fixed at the next Edition.

     

       Good luck.

    Wednesday, September 17, 2008 6:04 AM

All replies

  • Hello BillyM 2005,

     

       Could you please delete client caches to see if it works?

     

      1) Create a file named "tfscacheclean.cmd"
    2) Copy and paste:

    @echo off
    REM clean up most TFS cache files on current machine

    SETLOCAL

    @echo =====Cache Cleanup=====

    SET LOCALAPPDATA=%HOMEDRIVE%%HOMEPATH%\Local Settings\Application Data

    @echo Deleting the new common TF client cache directory (1.0)...
    if exist "%LOCALAPPDATA%\Microsoft\Team Foundation\1.0\Cache"  rd /s /q "%LOCALAPPDATA%\Microsoft\Team Foundation\1.0\Cache" > nul

    @echo Deleting the new common TF client cache directory (2.0)...
    if exist "%LOCALAPPDATA%\Microsoft\Team Foundation\2.0\Cache"  rd /s /q "%LOCALAPPDATA%\Microsoft\Team Foundation\2.0\Cache" > nul

    @echo Deleting Team Explorer cache files...
    if exist "%APPDATA%\microsoft\visualstudio\8.0\Team Explorer\."   rd /s /q "%APPDATA%\microsoft\visualstudio\8.0\Team Explorer" > nul
    if exist "%APPDATA%\microsoft\visualstudio\9.0\Team Explorer\."   rd /s /q "%APPDATA%\microsoft\visualstudio\9.0\Team Explorer" > nul

    ENDLOCAL

    :end

    3) Save
    4) Make sure any instances of Visual Studio are not running.
    5) Run script.

      From http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2876392&SiteID=1

     

      Do you use TFS 2005?

     

       As I know there is an issue at Source Control Explorer 2005,

     

       You can try to apply SP1 of 2005.

     

      If you are using TFS 2008.

     

       There is a similar issue, it will be fixed at the next Edition.

     

       Good luck.

    Wednesday, September 17, 2008 6:04 AM
  • Hello BillyM 2005,

     

       Could you please delete client caches to see if it works?

     

      1) Create a file named "tfscacheclean.cmd"
    2) Copy and paste:

    @echo off
    REM clean up most TFS cache files on current machine

    SETLOCAL

    @echo =====Cache Cleanup=====

    SET LOCALAPPDATA=%HOMEDRIVE%%HOMEPATH%\Local Settings\Application Data

    @echo Deleting the new common TF client cache directory (1.0)...
    if exist "%LOCALAPPDATA%\Microsoft\Team Foundation\1.0\Cache"  rd /s /q "%LOCALAPPDATA%\Microsoft\Team Foundation\1.0\Cache" > nul

    @echo Deleting the new common TF client cache directory (2.0)...
    if exist "%LOCALAPPDATA%\Microsoft\Team Foundation\2.0\Cache"  rd /s /q "%LOCALAPPDATA%\Microsoft\Team Foundation\2.0\Cache" > nul

    @echo Deleting Team Explorer cache files...
    if exist "%APPDATA%\microsoft\visualstudio\8.0\Team Explorer\."   rd /s /q "%APPDATA%\microsoft\visualstudio\8.0\Team Explorer" > nul
    if exist "%APPDATA%\microsoft\visualstudio\9.0\Team Explorer\."   rd /s /q "%APPDATA%\microsoft\visualstudio\9.0\Team Explorer" > nul

    ENDLOCAL

    :end

    3) Save
    4) Make sure any instances of Visual Studio are not running.
    5) Run script.

      From http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2876392&SiteID=1

     

      Do you use TFS 2005?

     

       As I know there is an issue at Source Control Explorer 2005,

     

       You can try to apply SP1 of 2005.

     

      If you are using TFS 2008.

     

       There is a similar issue, it will be fixed at the next Edition.

     

       Good luck.

    Hi.

    I had the same problem but this didn't work. I contacted Microsoft and I realized that in newer versions of visual studio we clear other folders for example for Visual Studio 2012 RC we should clear this Folder:

    %HOMEDRIVE%%HOMEPATH%\Local Settings\Application Data\Microsoft\Team Foundation\4.0\Cache\


    • Proposed as answer by Javid5555 Wednesday, August 29, 2012 2:56 PM
    Wednesday, August 29, 2012 2:53 PM
  • Hi,

    Deleting the local Cache for Team Foundation in AppData solved this issue for me!

    C:\Users\[USERNAME]\AppData\Local\Microsoft\Team Foundation\4.0\Cache

    Please delete all files in this folder and restart Visual Studio/Excel.

    Kind Regards,

    Pieter

    Sunday, September 30, 2012 8:58 AM