'Team Foundation Server - Unauthorized intermittently
Recently I've had this error pop up intermittently when trying to do things in a project:
- Checking In Changes
- Making edits to a recently unchanged file (checking out a file I assume)
- Opening Source Control Explorer
After a couple of tries or reloads it end up working. But, it's really annoying and just started happening.
- I tried clearing Internet Explorer browser history.
- I tried changing the login type microsoft.com/devicelogin.
- I tried clearing Visual Studio cache. (not sure if i cleared everything)
Side Note: I changed the name of my laptop recently and that seems to be around the same time I started having issues, not sure if that is related.
The same thing happens when using Visual Studio 2019 and 2022 community versions.
Any help would be appreciated. Thank you!
Solution 1:[1]
Try clear both local TFS cache and Visual Studio Cache, then try it again.
?1. Close all Visual Studio instances. 2. clear visual studio cache under
%APPDATA%\Microsoft\VisualStudio
- clear TFS cache under
%LocalAppData%\Microsoft\Team Foundation\{version}\Cache
- Go to Control Panel -> User Accounts -> Manage your Credential -> Windows Credential, select the TFS url to remove it.
- Restart your Visual Studio to re-connect to your TFS Server.
If that still not work, just try adding following code to your TFS web.config file (C:\Program Files\Microsoft Team Foundation Server 14.0\Application Tier\Web Services\web.config):
<configuration>
<system.net>
<settings>
<httpWebRequest useUnsafeHeaderParsing="true"/>
</settings>
</system.net>
</configuration>
UPDATE:
Try below things :
Run below command to reset the user data, then try it again.
cd C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE, devenv.exe /resetuserdataTry run as another user with command:
runas /netonly /user:<account> devenv.exeReset IIS and application pool
If that still not work, I suggest removing the VS first (clean uninstall), then reinstall it again..
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 |

