Your Search Bar For Shrewd Tips

How Do I Clear Tfs Cache?


If Visual Studio is showing outdated source-control information, failing to connect to Team Foundation Server (TFS), or repeatedly prompting you to sign in, clearing the TFS cache may help. The cache stores local data used to communicate with a TFS server or Azure DevOps Server. If that data becomes stale or corrupted, refreshing it can resolve some common client-side issues. This guide explains how to clear the TFS cache safely, where to find it, what to expect afterward, and what to try if the problem continues.

What Is the TFS Cache?

The TFS cache is a collection of local files that Visual Studio and related Microsoft tools use to make working with source control and work items more responsive. Depending on your software version and setup, it can contain information about server connections, version control, work items, and other client-side data. Azure DevOps Server was previously called Team Foundation Server, so you may see either name in documentation and configuration.

Cache files are not the same as your checked-out source code. Removing a client cache does not normally delete files in your workspace or remove changes you have made to them. However, the client may need to download fresh information from the server, and some settings or cached state may be rebuilt when you reconnect.

Clearing the cache is most relevant when the issue appears to be limited to one Windows user or one Visual Studio installation. It is not a universal fix for every TFS problem. Server outages, permissions, network configuration, workspace mappings, and incorrect credentials can cause similar symptoms.

When Should You Clear the TFS Cache?

Consider clearing the client cache if you have already confirmed that the TFS or Azure DevOps Server is reachable and you are experiencing a persistent client-side problem, such as:

  • Visual Studio displays outdated work item or source-control information.
  • A connection to a collection or project fails even though other users can connect.
  • Visual Studio repeatedly prompts you for credentials or appears to use the wrong account.
  • Source-control actions fail with errors that do not match your current permissions or workspace state.
  • The issue began after changing server URLs, upgrading Visual Studio, or switching accounts.

Before deleting anything, note the exact error message and check whether colleagues are having the same problem. If several people are affected, the cause may be a server or network issue, and clearing your local cache is unlikely to solve it.

How to Clear the TFS Cache in Visual Studio

The usual fix is to close Visual Studio and remove the contents of its local Team Foundation cache folder. The exact folder name varies by Visual Studio and Team Foundation client version, so use the steps below to locate the folder on your computer.

  1. Save your work. Save open files and make sure any important changes are safely stored. If you use a local workspace, check that your work is not relying on an unsaved change.
  2. Close Visual Studio. Also close other applications that may be using the same TFS connection, such as a separate Team Explorer window or a command-line client. In Task Manager, confirm that Visual Studio has fully exited if it appears to remain open.
  3. Open your local application data folder. Press Windows key + R, enter %LOCALAPPDATA%, and press Enter. This opens the application data folder for your Windows account.
  4. Find the Team Foundation folder. Open Microsoft, then look for Team Foundation. A typical location is %LOCALAPPDATA%\Microsoft\Team Foundation\.
  5. Open the relevant version folder. Inside, you may see a version-numbered folder, such as 12.0, 14.0, 15.0, 16.0, or 17.0. The number depends on the Team Foundation client components installed with your tools. If you are unsure which folder applies, check the folders that contain a Cache subfolder.
  6. Remove the cache contents. Open the appropriate Cache folder and delete the files and subfolders inside it. You can also rename the folder to something like Cache.old as a temporary backup. Do not delete your source-code workspace folders.
  7. Restart Visual Studio and reconnect. Open your solution, connect to the TFS server or collection, and repeat the action that was failing. The client will recreate cache data as needed.

If Windows says a file is in use, check that Visual Studio and other TFS-connected applications are closed. If the file remains locked, restart Windows and try again before opening Visual Studio.

Finding the Cache with File Explorer

You can use File Explorer instead of the Run dialog. Open File Explorer, enter %LOCALAPPDATA%\Microsoft\Team Foundation\ in the address bar, and press Enter. If the folder does not exist, your installation may store client data elsewhere, or the relevant Team Foundation components may not have been used under your current Windows account.

Do not assume that every folder containing the word “cache” is safe to remove. Visual Studio, NuGet, Git, and other development tools each maintain separate caches. For a TFS client issue, start with the Team Foundation cache folder rather than deleting unrelated data.

Clear Credentials Separately if Sign-In Still Fails

Clearing the TFS cache does not always remove saved Windows credentials. If Visual Studio continues to sign in with the wrong account or repeatedly asks for a password, review the credentials stored in Windows Credential Manager.

  • Open the Start menu and search for Credential Manager.
  • Select Windows Credentials.
  • Look for entries that clearly relate to your TFS or Azure DevOps Server address.
  • Remove only the relevant entry if you are certain it is the one causing the problem.
  • Restart Visual Studio and sign in with the correct account when prompted.

Credential entries can be used by more than one application. Avoid removing unrelated credentials, and make sure you know the correct account and sign-in method before deleting a saved entry. In managed workplaces, your administrator may control authentication or require a particular sign-in process.

What Happens After You Clear the Cache?

After you restart Visual Studio, the client may take longer than usual to connect or display project information while it rebuilds its local data. It may refresh work item lists, server details, or source-control information. This is expected. You might also need to reconnect to the appropriate server, collection, or project.

Clearing the client cache should not be treated as a way to remove source files, undo pending edits, or reset a workspace. Still, review your local changes before troubleshooting. If you use a server workspace, check pending changes in Visual Studio before proceeding. If you use a local workspace, keep your working folder intact and do not delete it while attempting to clear cache data.

Should You Clear the TFS Server Cache?

Most people searching for “how do I clear TFS cache” need to clear the cache on their own computer. The server has its own components and data stores, and changing or deleting server-side cache data is a different administrative task. It can affect other users, interrupt services, or make a broader problem worse if performed without understanding the server configuration.

Do not delete folders on a TFS or Azure DevOps Server machine simply because their names include “cache.” If multiple users experience the same issue, contact the TFS administrator. An administrator can review service health, application-tier logs, scheduled maintenance, and version-specific guidance before taking any server-side action. Server maintenance should be planned, authorized, and performed with appropriate backups and service procedures.

What to Try if Clearing the Cache Does Not Work

If the problem remains after clearing the client cache, use a few additional checks to narrow down the cause:

  • Verify server availability. Confirm that you can reach the server URL in a browser or through the supported client. Check with your administrator if the server may be down.
  • Check your account and permissions. Make sure you are using the intended account and still have access to the project, collection, repository, or work items involved.
  • Confirm the workspace mapping. In Visual Studio, review the workspace and local folder mappings. A stale or incorrect mapping can make source-control operations fail even when the cache is fresh.
  • Restart the relevant applications. Close Visual Studio and any other client that uses the connection, then reopen them after the cache has been removed.
  • Check for updates. Install supported updates for Visual Studio and its Team Explorer or Azure DevOps components. Client and server versions can affect compatibility and behavior.
  • Review the full error message. Record the error code, server address, and steps that trigger it. This information helps an administrator distinguish a cache issue from a permissions, network, or server problem.

Avoid repeatedly clearing unrelated folders or making server changes without a clear reason. If you need to report the issue, include what you tried, which Visual Studio version you use, whether the problem affects other users, and whether it occurs with one project or every project.

Frequently Asked Questions

Will clearing the TFS cache delete my code? Removing files from the Team Foundation client cache folder should not delete your workspace source files. Do not delete your workspace or working folder, and save or review local changes before troubleshooting.

Do I need administrator rights? Clearing the cache in your own profile usually does not require administrator rights. You may need help from an administrator if the folder is locked, your organization manages the installation, or the issue requires server-side investigation.

Why can’t I find the Team Foundation folder? The folder may not have been created for your Windows account, the client may use a different version-numbered directory, or you may be looking at another user profile. Search within %LOCALAPPDATA%\Microsoft for Team Foundation, and make sure Visual Studio has been run under the account you are troubleshooting.

Is the TFS cache the same as the NuGet cache? No. NuGet packages and other development tools have their own caches. Clear those only when the symptoms point to those tools; they are not a substitute for clearing the Team Foundation client cache.

Conclusion

To clear the TFS cache, close Visual Studio, open %LOCALAPPDATA%\Microsoft\Team Foundation\, locate the applicable version folder, and remove or rename the contents of its Cache subfolder. Then restart Visual Studio and reconnect so the client can rebuild its local data. Keep your workspace and source files untouched, and treat saved credentials as a separate issue. If several users are affected or the problem continues, ask your TFS administrator to investigate the server, account, and network rather than making unverified server-side changes.


Disclaimer: Articles are written by Humans, AI or Both. Verify Important information.

Shrewdnia

Shrewdnia

Shrewdnia is a destination for curious minds seeking clarity, knowledge, and informed perspectives. Through insightful articles and practical guides our passionate team explores a wide range of topics designed to help readers understand the world around them, make smarter decisions, and stay informed in an ever-changing landscape.


💡 Every question sparks discovery, and every perspective enriches the conversation. Share your thoughts and insights in the comments 👇

Back to blog

Leave a comment

JOIN THE SHREWDNIA COMMUNITY FORUM

What do you think?

Have an opinion, experience, or question about this topic? Join the Shrewdnia Forum and share your thoughts with other readers.

Join the Forum →