How to clear Microsoft Teams cache for Global users

Microsoft Team Cache issues 1 Reputation point
2021-04-13T10:59:36.803+00:00

Hi All

We have an customised application which will be attached with MS Teams to operate.
Users have encountered some issue with UI. After the fix has been deployed, many users were able to see the expected results.
But few users are not. They were able to see the expected results only after clearing MS Teams cache in their machine.

We can't able to clear the cache manually for each users. Kindly let us know, is there any option to clear the Teams cache globally?

Kindly suggest your ideas on it.

Developer technologies | .NET | Other
Developer technologies | C#
{count} votes

1 answer

Sort by: Most helpful
  1. Timon Yang-MSFT 9,606 Reputation points
    2021-04-14T02:04:19.367+00:00

    I did not find an existing API to directly clear the cache, but we know the location of the cache:

    C:\Users\<username>\AppData\Roaming\Microsoft\Teams

    We can delete him in this way:

    System.IO.DirectoryInfo di = new DirectoryInfo("YourPath");  
      
    foreach (FileInfo file in di.GetFiles())  
    {  
        file.Delete();   
    }  
    foreach (DirectoryInfo dir in di.GetDirectories())  
    {  
        dir.Delete(true);   
    }  
    

    There are two things to pay attention to.

    One is that this program may require administrator rights to run, and the other is that Outlook and Teams have a certain degree of integration, so you need to exit both Teams and Outlook to delete successfully.


    If the response is helpful, please click "Accept Answer" and upvote it.
    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.

    0 comments No comments

Your answer

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