Today I had an issue connecting to a Team Foundation Server using Team Explorer in Visual Studio 2012. Selecting the Server it always tried to connect with a wrong user, displayed in the lower left corner of the connection window:
My problem was, that I tried to connect to this server earlier using a different user when I was prompted for credentials, since the currently logged on user didn’t had the appropriate rights to connect to TFS.
Now, after setting the right permissions, I wanted to connect with the currently logged on user again, but I was not able to change the user in Team Explorer – the credentials got cached.
Searching around, I found that these credentials are cached in the Windows Vault provided by the Credential Manager (Control Panel\User Accounts\Credential Manager):
After deleting the cached credentials for the TFS, you have to close and reopen Visual Studio for this settings to take effect.
Now when I connect to the TFS the currently logged on user is used: