Visual Studio 2022 clear local caches

Dmtr_Grms 331 Reputation points
2023-04-11T17:43:02.8766667+00:00

How to clear all the caches from Visual Studio? I started to use Visual Studio some month ago (first 2019 and then 2022). I had to uninstall and install again Visual Studio several times but I noticed a lot of garbage in the local cache directory (one example almost half GB in C:\Users\xxxx\AppData\Local\Microsoft\VisualStudio\Roslyn) What should I do to to clean all theses caches? Thanks in advance for your help.

Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
4,639 questions
0 comments No comments
{count} votes

Accepted answer
  1. Dou Xu-MSFT 170 Reputation points Microsoft Vendor
    2023-04-12T07:02:52.6833333+00:00

    Hello @Dmtr_Grms ,

    Thanks for taking time to post this issue in Microsoft Q&A forum.

    Please find visual studio 2022 cache folders by following:

    1 Component Cache

    Close Visual Studio (ensure devenv.exe is not present in the Task Manager) and delete the C:\Users\xxxx AppData\Local\Microsoft\VisualStudio\your version xxx\ComponentModelCache directory

    2 Temp folder

    Delete the C:\Users\xxxx \AppData\Local\Temp directory

    3 Roslyn folder

    C:\Users\xxxx\AppData\Local\Microsoft\VisualStudio\Roslyn

    NET Compiler Platform, also known by its nickname Roslyn, is a set of open-source compilers and code analysis APIs for C# and Visual Basic languages from Microsoft. Deleting this cache folder will not affect Visual Studio, but it may affect the loading speed of .NET Compiler Platform Roslyn Analyzers.

    Besides, if you want to save memory space, you can unselect download cache to not keep the download cache, the download cache location is only temporarily used. Also, it’s a workaround to write a script to clean up the cache folder periodically instead of manual deletion. For example

    Remove-Item `your cache path` -Recurse
    

    Feel free to contact us.

    Sincerely,

    Douxu


    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.

    4 people found this answer helpful.

0 additional answers

Sort by: Most helpful