How to reduce the contents of the TFSTemp folder?

Hugh Griffiths 5 Reputation points
2023-06-08T09:11:27.65+00:00

I noticed that my temporary files folder had reached 80GB in size and in that the TFSTemp folder is currently holding just over 52GB of files, some dating back over a year. All files appear to be amended/saved copies of c# files. i'm under the impression that these should be deleted periodically and comparing to another system this file is only 5GB in size.

What steps do i need to take to reduce the files in this folder, are there some settings that need to be turn on to determine the length of time these files are retained?

Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
4,814 questions
{count} vote

3 answers

Sort by: Most helpful
  1. Anna Xiu-MSFT 27,556 Reputation points Microsoft Vendor
    2023-06-08T13:53:25.9966667+00:00

    Hi @Hugh Griffiths, 

    Welcome to Microsoft Q&A! 

    I suppose a good way is to delete the %TMP%\TFSTemp folder regularly. 

    Besides, the TFSTemp folder is TFS temporary directory. Please report it in dedicated TFS forum

    Sincerely,

    Anna


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment". 
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


  2. Sean Brockway 1 Reputation point
    2024-05-13T15:31:53.14+00:00

    I ran into this issue because "Find all references" kept showing results in this folder. I navigated out to it and found 144,000 files. Took a few minutes to empty the folder.
    I wonder if whatever is supposed to clean this temp folder up is broken? Or was broken for a while and is now overwhelmed by the amount to clean up.

    0 comments No comments

  3. Andre Vergison (avergiso) 1 Reputation point
    2024-06-30T10:20:50.39+00:00

    Yeah, a real pain it is!

    I found out that the files in TFSTemp are revisions of git branches.

    Whenever you check out to some other branch, then for each file currently open in your VS, one or more revisions (file snapshots) will be stored in TFSTemp and never get cleaned up.

    So if you would do (as I often do) a batch compilation (test) on every commit of a long branch (git rebase with -x option) AND you have many files open in VS, THEN you'll get tens of gigabytes of TFSTemp garbase in no time! The A times B effect.

    0 comments No comments