Search code examples
visual-studioazure-devops

An attempt to communicate with Azure DevOps failed because a token could not be retrieved


I have projects that I have controlled be Azure DevOps. Every time when I open some of these solutions in the Visual Studio I get following error in the team explorer:

enter image description here

So when I re-enter my credentials I get the same error again. But when I restart Visual Studio my project is suddenly properly connected to Azure DevOps.

Could you tell me why I have this issue and how to solve it?


Solution

  • You may try the following items:

    1. Go to Control Panel > Credential Manager, and remove all Windows Credentials related to TFS.
    2. Close all Visual Studio instances, and delete the %LOCALAPPDATA%\.IdentityService folder if it exists.
    3. Clear TFS caches %LOCALAPPDATA%\Microsoft\Team Foundation\x.0\Cache
    4. As @4c74356b41 mentioned, repair VS.