在加载 VisualStudio 时,如何更改用于连接到 VisualStudioOnline (TFSPreview)的默认凭据?

当我加载 VisualStudio2012时,它将尝试连接到它所连接的以前的 TFS 服务器。

在我的一台机器上(偶尔也会连接到 TFS2008和 TFS2010服务器) ,似乎总是默认连接到 Visual Studio Online (tfspreview)完全错误的帐户,如果我尝试获取最新版本,它会给出一个表单错误:

MicrosoftVisualStudio

源代码管理资源管理器

TF204017: 操作无法完成,因为用户(Account Service ([ my tfs server ])没有一个或多个工作区[ my workspace ]所需的权限(Use) ; [ my live id ]。

好的

如何影响 VisualStudio2012默认使用正确的凭据,而不是看似虚构的帐户服务凭据?

119617 次浏览

I had a very similiar problem as I was not able to connect to TFS with my own credentials. Turned out that the user who had created the image (I was using Hyper-V) stored his account in Credential Manager. There was no way to change this in Visual Studio. To solve the issue, I opened Credential Manager in Control Panel and edited the Generic Credentials to be my own account. I closed and opened Visual Studio 2012, and reconnected to TFS. It prompted me for my credentials, but it connected with my account from then on.

hope this helps, sivilian

I tried opening my Credential Manager but could not find any credentials in there that has any relation to my TFS account.

So what I did instead I logout of my hotmail account in Internet Explorer and then clear all my Internet Explorer cookies and stored password as detailed in this blog: Changing TFS credentials in Visual Studio 2012

enter image description here

After clearing out the cookies and password, restart IE and then relogin to your hotmail (or windows live account).

Then start Visual Studio and try to reconnect to TFS, you should be prompted for a credential now.

Note: A reader said that you do not have to clear out all IE cookies, just these 3 cookies, but I didn't test this.

cookie:@login.live.com/
cookie:@visualstudio.com/
cookie:@tfs.app.visualstudio.com/

You need to remove TFS credentials from Windows Vault to clear and force to ask new TFS credentials in Visual Studio

  1. Go to Control Panel (Start -> Control Panel).

  2. Click User Accounts ( or User Accounts and Family Safety->User Accounts in Windows 7 Machine)

  3. Click Credential Manager (or Manage your credentials)

  4. In Credential Manager page, you can see the two type of credentials

       i. Windows Credentials
    ii. Generic Credentials
    

5.Click on two credentials modify link, click the link Remove from vault to remove stored TFS credentials.

Now, When you login into Visual Studio you will be asked to give credentials to connect TFS.

Note: Don't forgot to uncheck the option Remember my credentials to force to ask credentials for every TFS connections.

i found another solution:

  1. start session in TEAM
  2. go to SOURCE CONTROL and select WORKSPACE (mark in red)
  3. then Add new Workspace... why?
  4. because you dont work in the same workspace whey you change your account in TFS (i dont know why)
  5. and ready to MAP your project again.

Its 100% guaranteed to work.

I ran into this same issue. Someone had logged onto my computer and used their TFS credentials. I'm running VS2012, Windows 7, and the network admins have Credential Manager disabled.

Run this command from a command window with the same user your running visual studio as.

rundll32.exe keymgr.dll,KRShowKeyMgr

You'll see a popup with all your stored credentials. Remove the one for your TFS server.

Note: You will need to restart visual studio because it caches the tfs credentials.

You can also try to reset visual studio setting

  1. Open Visual Studio Command Prompt

  2. Enter command Devenv /ResetSettings

It will remove already saved TFS account and ask for credentials

For Windows 8:

Control Panel -> (Search for) Credentials Manager -> Check Web Credentials

this worked for me...

After failing with cleaning the Credentials from the Manager and clearing the VS cache, consider to repair Visual Studio from the Visual Studio Installer (VS2017). I personally found no other solution working.