Clear stored TFS credentials in Visual Studio 2017 - tfs

I had to change my password for my account which is not the same account i log into my machine with. When connected to the local tfs server, I supplied my password to VS2017 and checked remember password. Now that the password has changed, I cannot connect.
I have tried to remove the tfs in credential manager and also deleted the .IdentityService. Neither have helped. Anyone know if they changed something with VS 2017 and they are cached or stored somewhere else?

Please try below items to narrow down the issue:
Remove the TFS related credentials from Credential Manager
In Credential Manager add the new updated Generic Credentials for the TFS account.
Generally, this would overwrite the cached credentials.
Close all Visual Studio instances, delete
%LOCALAPPDATA%\.IdentityService as you did.
Clear TFS caches %LOCALAPPDATA%\Microsoft\Team Foundation\7.0\Cache
Clear all the browser caches especially for the stored password
Restart Visual Studio > Team Explorer > Manage Connections to check
if the Enter credential dialog popup. Just try this several times.
Based on my test the dialog will popup the first time, but if you cancel
it, then you have to restart VS to popup it again.
Run Visual Studio as another user:
cd C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE
runas /netonly /user:<account> devenv.exe
Enter the user possword, then Team Explorer > Manage Connections

I tried to follow the steps listed in the other answer.
But on first step I decided to try just editing the password in credentials manager. It worked for me.
So if anyone else is having the same problem you might want to try that first.

Clear the config from the following path:
C:\users\<user>\AppData\Roaming\Microsoft\VisualStudio\15.0_????\Team Explorer\

These Steps worked for the issue : The V2 feed returned an unexpected status code '403 Forbidden' for configured nuGet package through Artifactory
Remove the TFS related credentials from Credential Manager
1)In Credential Manager add the new updated Generic Credentials for the TFS account. 2)Generally, this would overwrite the cached credentials.
Close all Visual Studio instances, delete %LOCALAPPDATA%.IdentityService as you did.
Clear TFS caches %LOCALAPPDATA%\Microsoft\Team Foundation\7.0\Cache
Clear all the browser caches especially for the stored password
Restart Visual Studio > Team Explorer > Manage Connections to check if the Enter credential dialog popup. Just try this several times. Based on my test the dialog will popup the first time, but if you cancel it, then you have to restart VS to popup it again.

I had face a typical problem with Visual Studio 2017. I was using VSTS. First time i had connected With one credential, later on i was trying to change credential. But it was not taking. Then after a long effort finally i found there have a folder.
C:\Users\ {your user name} \AppData\Local\GitCredentialManager
just delete all the file inside this folder and try. Hope it will work.

I had an issue where TFS kept connecting with the wrong credentials.
The solution that worked for me was to run the following command line:
tf vc workspaces /login:MY_USERNAME /collection:http://TFS_SERVER_PATH

In Windows search for Manage Your Network Passwords, from there you can delete and modify saved credentials

In our case, we had to change the user account to log into TFS on the same machine.
None of above solutions did not work for us except changing the computer name.

Other answers didn't work for me.
Goto File->Account Settings->All Accounts remove the account you want.

Related

After update to Visual Studio 2019 on Mac, integration with Azure DevOps TFS server broken

After my recent upgrade to Visual Studio 2019 (?) on Mac, I am unable to connect to my TFS server using the TFS Source Control extension.
My current setup:
Visual Studio for Mac, version 8.0.3.14
Source Control Extension:
Team Foundation Version Control for TFS and Azure DevOps Version
0.4.4.5
Steps: In Team Explorer, now I see two options:
1) Add Account
2) Add Server
When I try Add Account, a dialog pops up asking for my MS credentials - I enter them as usual, and then nothing further happens, no feedback whatsoever. Is this because it thinks this account is already "added"?
When I try Add Server, I enter my azure dev ops server name, then for user name/password I enter my MS account email and password. I leave domain empty. I get a message:
"Server already exists."
Here is what I expect to see (screenshot from VS 2017 on Windows):
Instead, nothing gets populated the way it normally does in Team Explorer: Pending changes, work items, settings - the entire panel is empty:
I do switch between Windows and Mac a lot, but if I remember correctly, everything worked fine from both workspaces before, so it probably happened when I upgraded to Visual Studio 8.0.3.14 on my Mac. Any ideas on how to fix this?
I wondered the same thing but without the update process in my back pocket... meaning I haven't written any C# in a while but I'm coming back to it. I set up a project with TFS in Azure Dev Ops on my pc, then went to check it out on my Mac and couldn't find any reference anywhere to TFS. Subversion and Git are in there, but no TFS. It took a little while to find it, but here's what I found. The short answer is they want you to use Git, not TFS as TFS is not supported in VS 2019 for Mac. The article does list work-arounds.
https://learn.microsoft.com/en-us/visualstudio/mac/tf-version-control?view=vsmac-2019

How to check out file in Visual studio code with TFVC?

I have TFS 2017 server which I integrated with my Visual studio code using visual studio team services plugin. I am able to login however when I edit any file and try to save, vs gives me error prompt.
Failed to save 'app.component.html': File is write protected. Select 'Overwrite' to attempt to remove protection.
How do I configure my VS code so that I can check out automatically like vs 2017 ?
Please try below things to narrow down the issue:
Try running the VS code as administrator to check if that works.
You have lost the connection to the Team Foundation Server:
In this case you can try to sign out then sign in again to reconnect.
Alternately you can try removing the current workspace then create a
new one and reconnect to TFS again using the new workspace. Reference
this thread:
Why are all files write protected and how can I check-in?
The problem may be caused by some extensions installed for the VS
code.
In this case you can try resetting User/Project settings to their
defaults and disabling vscode extensions to see if this is an issue
with vscode or a specific extension. If doing this fixes the issue,
try turning on the extensions one at a time and configuring the
User/Project settings to what they were until the culprit is
revealed. Reference nwayve's comment in this thread:https://github.com/Microsoft/vscode/issues/13592
Remove the visual studio team services plugin, then install it again
and reconfigure it, you can reference my answer in another
thread to do that.

how to fix Error TF30063: You are not authorized to access VS2017

I changed my password for my TFS. But when I try to reconnect I receive the TF30063 unauthorized error.
There are many issues like this and I tried everything I could find from this solution and other forums
Solve this issue by using the VS browser
The right click on the connection
The windows 10 manage user accounts edit and even the remove
Deleted every VS cache file from appdata
Deleted the whole connection in VS & tried to readd a new one
Deleted all my Internet explorer cookies, passwords cache etc.
None of them work... Can't figure out what the issue is.
PS: it works within the browser.
It should be a Visual Studio 2017 credential cached token issue. You could try below ways to clear cache:
Close all Visual Studio instances.
Delete %LOCALAPPDATA%.IdentityService.
There are some identity related caching going on in there, deleting the folder will force the identity system to rebuild its cache.
Also Clear TFS related caches %LOCALAPPDATA%\Microsoft\Team Foundation\x.0\Cache
Run Visual Studio as another user:
cd C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE
runas /netonly /user:<account> devenv.exe
Enter the user password, then Team Explorer > Manage Connections
If the issue still exists, also take a look at this blog for more ways.
Based on developer community there is a timing issue during visual studio start up that can cause the Source Control Explorer window to grab and then hang on to an invalid version of the connection to your team project. Details visit developer community.
https://developercommunity.visualstudio.com/content/problem/93366/tf30063-you-are-not-authorized-to-access-visualstu.html
Following work around steps help me to resolve the issue
Close all visual studio 2017
Start Visual studio 2017
If you see source control explorer at start up, then close source control explorer and Team explore and close visual studio 2017
Open visual studio 2017, ensure no source control explorer opened at start up
Go to View menu and click on team explorer
Then connect to TFS server.
I've gotten the above error (TF30063: You are not...) numerous times and the following three resolutions worked for me at different times:
Simplest: I've seen "Source Control Explorer" referenced numerous times, but I never leave that open. I resolved the above error by closing Team Explorer and reopening. I then loaded my solution, and then reopened Team Explorer. It opened without issues and I could contact the server (ie, I ran a code comparison in the Solution Explorer on a file I'd edited) -VS Pro 2017 v 15.8.0
Middle complexity:
I was able to reconnect with the following steps:
-Open Team Explorer (View menu => Team Explorer)
-Click "Manage Connections" which is the plug shaped button at top
-Click the text "Manage Connections" which is actually a drop down menu
-Select "Connect to a Project"
This brings up a new window that shows hosted repositories for your account. After several seconds the window displayed the desired projects. I just had to click the desired one and click the "Connect" button at the bottom. Once I did this, I was able to access all TFS features (ie I checked in some work) -VS Enterprise 2017 v15.9.3
Last resort:
I loaded VS2017 Community onto another machine and logged in on that machine using my regular login. I'm not sure why, but as soon as I logged in on this new installation my other two computers had no problem connecting. No additional steps were needed, though I may have restarted VS on those machines.
I will be facing this issue every six times a year. Because domain account password gets expired every 2 months 0 days or 8 weeks 5 days or 61 calendar days interval due to business security policy.
Follow these steps to change/set Password of TFS from IDE
Delete TeamExplorer.config from
%AppData%\Microsoft\VisualStudio\15.0_xxxxxxxx\Team Explorer.
(So after establishing a successful connection, it'll try to recreate
again with the same data)
Add or change the TFS account Credential from Windows Credential Manager. So it won't prompt to enter a password again whenever when a connecting is established from IDE to TFS
If the above doesn't work close the Visual Studio IDE. Delete all the files inside %LocalAppData%\.IdentityService and %LocalAppData%\Microsoft\Team Foundation\7.0\Cache and on elevated prompt execute runas /netonly /user:<user domain account> devenv.exe navigating from "C:\Program Files (x86)\Microsoft Visual Studio\2017\<Professional>\Common7\IDE\"
I had this same problem, and the solution I finally found was when VS asked if this was a "Work or school account" or a "Personal account" I chose "Personal account", and that fixed it even though it is a work account. This used to work fine, but it seems with some recent updates it causes an issue if you select "Work or school account"
I also had this problem with VS2017, version 15.9.4.
Common fixes are detailed here and here. And the majority of pages talking about this problem reference those solutions or sub-sets in some combination or another. (And often to fix login bugs introduced in one of the 15.5.* versions of VS2017)
None of those solutions worked for me either and after researching for 2 days, I found a couple of fringe-reasons why VS 2017 will not refresh/store credentials.
The 2 main "fringe" problems/fixes I've found are:
Connecting through certain proxy setups
Cryptography store not allowing for local storage, see also here
For myself it was the second problem, a good indicator of the issue is a log entry in %TEMP%\servicehub\logs with the error: "The requested operation cannot be completed. The computer must be trusted for delegation and the current user account must be configured to allow delegation."
It might also be a Windows 7/8.1 known issue carried over to Windows 10 upgraded machines. The problem only happened on a machine that joined the domain after doing the Windows 10 upgrade.
The fix is to add the following registry entry:
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography\Protect\Providers\df9d8cd0-1501-11d1-8c7a-00c04fc297eb]
"ProtectionPolicy"=dword:00000001
Setting that immediately fixed the issue with VS2017 connecting to the Microsoft Account. (And some other applications that would not persist credentials between launches)
After you have tried making changes to default browser and installing new browser like firefox or chrome, if still doent work, then you might have to check with network team of your organization on proxy settings that should be allowed in internet options. We have tried the above and it worked.
Maybe this only happened to me but I always used the wrong credentials (wrong username or wrong password). On Windows 11 I was only using my PIN, so it took automatically a user and password. I had to use different credentials to change my name and password.

Connect TeamCity to Visual Studio Online

I'm trying to migrate from on-premises TFS to Visual Studio Online. We have quite elaborate TeamCity build process that we don't want to migrate away from, so having TeamCity working with VSO would be ideal.
I've created alternative user credentials (as per this article) and using these credentials in TeamCity. But when I create new VCS in TeamCity, I get connection error:
TF30063: You are not authorized to access https://myproject.visualstudio.com/DefaultCollection/MyProject
I've tried my actual credentials (not alternative ones) but nothing changed - same error.
Also I've tried using alternative credentials with tf command line tool and could not enter alternative credentials - a window popped up, asking me for my LiveId.
Any idea how to fix this?
p.s. this is how TeamCity configuration look like:
To connect to Visual Studio Online you indeed need to enable alternate credentials on the account you'll use for Team City. Ensure that at least Team Explorer 2012 and update 4 is installed on the Team City server, install the whole Visual Studio 2012 incl Update 4. Team City requires at least update 2, but Microsoft only supports Visual Studio 2012 RTM and the latest update (which is update 4).
Then in the connection screen use the following information:
Repository URL: https://myaccount.visualstudio.com/DefaultCollection
Username: ##LIVEID##\your.email#live.com // Your visual Studio Online User Name, must match your LiveId.
Password: ********* // The password you setup for the alternate credentials.
You can also use the VSO Service Account credentials instead of using Alternate Credentials.
Then in your VCS Root configuration map your TFVC root in the following way:
Root: $/MyProject/Path/To/Branch/Root
Check out this post on the Jetbrains Confluence site for more details.
This has changed lately and the password needs to be generated.
Navigate to your site at https://[your project].visualstudio.com/_details/security/tokens
And generate a personal access token. And use it for password in your teamcity vcs root configuration. Username is your email.
https://streamlined.no/2016/09/19/connecting-teamcity-10-vcs-root-visual-studio-team-services/
Note: TeamCity 10 does not need the ##LIVE## workaround anymore.
I had the same problem today. The TC instance which was working fine last week mysteriously could not connect to any VCS Roots after the weekend. All VCS roots are git repos in visual studio online.
The Test Connection was failing and changing to known working user accounts still failed.
Restarting the TC service also had no impact on the problem. In the end, rebooting the whole TC Server fixed the issue. Hopefully this will help someone else out.
Well, I could not use Alternate credentials as I use it in many build configurations and it was set up to poll every 60 seconds. So I had to do much manual work to fix it up. Instead, I generated a Personal Access Token and in the Team City VCS setup for Git I entered "username" as the username and pasted the PAT into the password. That worked much better and more stable than Alternate credentials, which kept getting disabled because of background polling on behalf of Team City.

TFS cannot access from Explorer since changed password?

I have downloaded the TFS Power Tool 2011 and I love it. I had to change my Windows password and since, I can't log via the Explorer. When I right click on the folder, I have only the option "Reconnect to Server" and it fail everytime I try. I can connect to the repository via Visual Studio 11 with the Team Explorer, a popup came and I enter my new credential, all works. But, not in Explorer. How can I add my new credential with TFS Power Tool?
A bit difficult for me to test this but try following the procedure in point 1 of http://blogs.msdn.com/b/bharry/archive/2008/11/10/common-oct-08-tfs-power-tools-questions.aspx for changing your credentials for connecting to the TFS server. It is possible you will need to reboot or at least log out and log in to restart the shell extension.

Resources