Temporary files in using Visual Studio 2022

Phan Huỳnh Hưng 0 Reputation points
2025-08-30T01:45:45.8133333+00:00

I have recently downloaded Visual Studio 2022 after reinstalling Windows and I realized that it continuously created temporary files in temp folder. After I turn off, all files are deleted but when I use in long time, it takes me until 30GB and my free space is not enough for it. Before I reinstall, it didn't take me so much and didn't write continuously. Please help me to fix this

Developer technologies | Visual Studio | Testing
{count} votes

1 answer

Sort by: Most helpful
  1. Adiba Khan 970 Reputation points Microsoft External Staff
    2025-09-01T10:05:40.0666667+00:00

    Fix:

    1.      Clear Temp Manually/ Automatically

    ·         Press Win + R, type %temp%, and delete unnecessary files.

    ·         Use Windows Disk Cleanup or Storage Sense to automatically remove temp files.

    2.      Check Visual Studio Settings

    ·         Go to Tools > Options> projects and solutions

    ·         Look for paths pointing to Temp and Redirect them to another drive if needed.

    3.      Disable Diagnostic Tools Auto Collection

    ·         Go to Debug>Windows>Show Diagnostic tools.

    ·         In settings, disable Enable Diagnostic tools while debugging if you don’t need it(This can generate very large .dmp and trace files in temp.)

    4.      Limit or clean component cache

    ·         Run in Developer command prompt for VS:

    ·         This clears cached component data.

    Devenv.exe /clearcache

     

    5.      Check extensions

    ·         Some extensions(e.g., ReSharper, code analyzers) generate lots of temp files.

    ·         Try disabling extensions and see if the problem reduces.

    6.      Update Visual studio

    ·         Make sure you are on the latest VS 2022 version – some builds had issues with excessive log/temp file creation

    7.      Redirect TEMP folder(optional)

    ·         If space is limited, change the TEMP/TMP environment variables to another drive with more space.

    Hope this helps, please let me know if you have any other query and if it helps please mark the answer as answered.


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.