If you have problems with TFS or Visual Studio flush the user cache … or not?

Updated 2010-09-22 ... changes in blue italic.

BUT … before you go down this “drastic” route, please get a cup of coffee and think about pressing the Enter key.

WHY … The side effects are that your personal environment resets to default and many, if not all, the Visual Studio extension  have to be re-installed. The worst side effect, unless you are Swiss and keep everything documented to the nth degree, is that the Team Foundation Server and Collection configuration evaporates during the user data reset.

With many problems, such as the infamous Red X issue, the common resolution is often to flush the local cache by completing the following steps:

  1. Delete the contents from the following folders
    • C:\Users\<<Your Alias>>\AppData\Local\Microsoft\Team Foundation
    • C:\Users\<<Your Alias>>\AppData\Local\Microsoft\VisualStudio
    • C:\Users\<<Your Alias>>\AppData\Local\Microsoft\VSCommon
  2. Go to the Visual Studio IDE folder in command prompt and Run the following command "devenv /resetuserdata" from the Visual Studio IDE folder.
    • Typical location for 64 bit: C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE
    • Typical location for 32 bit: C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE

While this feature has its place, it needs to be used with some pre-Enter-Key thought and planning, and anyone recommending this to anyone should also highlight the side effects … or face a VERY unhappy customer.

To minimise the potential loss of your personal environment, you should consider creating a backup of your environment using the Export Settings wizard, and the Import Settings wizard to restore the settings if and when needed.

… loaned from book “Software Engineers on their way to Pluto”, symbolizing the possible side effects 🙂

Comments (18)
  1. I read this as time for the Rangers to dig through the API, call some friends for some undocumented info and build a tool which gives you two options:

    1) Clean cache & keep settings

    2) Reset everything

  2. From a Ranger to Ranger … yes 🙂

  3. Stefan B says:

    Thanks a lot! This saved me a lot of time.

  4. Thank to you, I think I saved lots of days spending how to reconfigure my solution to another TFS while old one was completely removed.

  5. Worked like a charm 🙂

  6. Rai says:

    Just when I was about to give up..thanks:)

  7. dalmirogranias says:

    Worked for me. Thanks Willy.

  8. Anders Rosten says:

    Thanks! Helped me solve this following error which was probably caused by cached areas:

    "An error occured while running the selected "Available Work Items" query: TF51011: The specified area path does not exist. The error is caused by 'My projectGeneral'"

  9. Paul says:

    It breaks me whole Visual Studio.

    1. I provided a somewhat simpler solution that won’t result in the loss of your personal environment settings and Visual Studio settings when you’re trying to resolve wacky TFS problems such as irrelevant files being continually added to your Included Changes every time you restart Visual Studio. Although this fix was for VS2013, I believe it might also resolve similar issues in VS2015. You might try it before you go the drastic route; hey, it just might save you the drastic consequences of a full flush! See https://stackoverflow.com/questions/45798878/visual-studio-2013-and-tfs-all-excluded-changes-being-included-back-automatica

  10. Suggester says:

    Just a thought (silly as it may be) Put the disclaimer above the command.

    For someone going step by step quickly through, I had already run the command before I got to the disclaimer.

    I didn't have anything important set up, but someone else might.

  11. Johnny B says:

    Whew! Thanks! Got it!

  12. Bob Marley says:

    The cache pattern is supposed to make things quicker but is does not. It makes things much less reliable and makes me spend most of my time finding which broken cache to empty. Can all software engineers please stop attempting to implement caches.

  13. nukemm says:

    A little old, but 62 bit lol

  14. William Denman says:

    Still quite handy and work very well with VS 2015

  15. Graham says:

    We just completed this for a developer who was getting cache and dll errors after we upgraded TFS from 2013 to 2015. He is now error-free. Thanks for the tip.

  16. wlbm_onizuka says:

    I had annoying problem for a long time: VS requests me for “Reenter credentials” very often.
    I followed this instruction and it did not help.
    The solution is additionally remove C:\Users\<>\AppData\Local\.IdentityService


Comments are closed.

Skip to main content