MohamedG's Log

TW9oYW1lZCBFbC1HZWlzaA==

How to: Clean TFS cache?

If your TFS client cache is corrupted, you might see this error:

—————————
Microsoft Visual Studio
—————————
Error

An item with the same key has already been added.
—————————
OK  
—————————

Here’s a solution, run the following to clean the cache:

SET AppDataTF=%USERPROFILE%\Local Settings\Application Data\Microsoft\Team Foundation
SET AppDataVS=%APPDATA%\Microsoft\VisualStudio
IF EXIST “%AppDataTF%\1.0\Cache” rd /s /q “%AppDataTF%\1.0\Cache” > NUL
IF EXIST “%AppDataTF%\2.0\Cache” rd /s /q “%AppDataTF%\2.0\Cache” > NUL
IF EXIST “%AppDataVS%\8.0\Team Explorer” rd /s /q “%AppDataVS%\8.0\Team Explorer” > NUL
IF EXIST “%AppDataVS%\9.0\Team Explorer” rd /s /q “%AppDataVS%\9.0\Team Explorer” > NUL