VS 2015和VS 2017如何使用不同的账号连接TFS? [英] How to use different accounts to connect to TFS in VS 2015 and VS 2017?

查看:57
本文介绍了VS 2015和VS 2017如何使用不同的账号连接TFS?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已在 VS 2015 中连接到 TFS,凭证显示为username2015",并且工作正常.现在,当我在 VS 2017 中配置相同的 TFS 时,它使用现有的凭据username2015".但我的问题是在 VS 2017 中连接到 TFS 时,我想使用不同的凭据说username2017".

I have connected to TFS in VS 2015 with a credential say 'username2015' and it works fine. Now when I configure the same TFS in VS 2017, it uses the existing credential 'username2015'. But my problem is I want to use a different credential say 'username2017' when connecting to TFS in VS 2017.

换句话说,我正在寻找一种在 VS 2015 和 VS 2017 中使用不同帐户连接到 TFS 的方法.

In other words, I am looking for a way to use different accounts to connect to TFS in VS 2015 and VS 2017.

推荐答案

在连接到我的网络时,我已经使用了 TFS 用户名username2015"团队中客户的 TFS -> 在 VS 2015 中管理连接.现在在 VS 2017 中,我想使用另一个用户名username2017"连接到同一个 TFS.

I've already used a TFS username "username2015" when connecting to my client's TFS in Team -> Manage Connections in VS 2015. Now in VS 2017, I want to use another username 'username2017' to connect to same TFS.

首先确保在 TFS 中添加了 username2017,请参阅 快速入门:将用户添加到团队项目或特定团队

Firstly make sure the username2017 is added in TFS, see Quickstart: Add users to a team project or specific team

如果是第一次在当前 Windows 用户帐户下连接到与 VS 2017 相同的 TFS,那么您可以直接在 VS 2017 中使用 username2017(Team Explorer-> Manage Connections),会弹出登录对话框让你登录,和VS 2015没什么区别.

If it's the FIRST TIME connecting to same TFS with VS 2017 under current windows user account, then you can use username2017 directly in VS 2017 (Team Explorer -> Manage Connections), it will popup the login dialog box for you to sign-in, nothing different with VS 2015.

但是如果您曾经在 VS 2017 中使用其他 tfs 帐户连接到 TFS,那么它会自动使用您之前从 Windows 登录服务登录的 tfs 用户帐户并检查您是否能够登录到选定的 TFS服务器.这意味着如果该帐户仍然可用,它将自动使用先前的 tfs 帐户连接到 TFS.如果密码更改,则会弹出对话框让您输入新密码重新登录.

But if you have ever connected to the TFS with other tfs accounts in VS 2017, then it will automatically use your previous logged-on tfs user account from Windows Sign-on services and check if you are able to login to selected TFS Server. That means it will automatically connect to TFS with the pervious tfs account if the account is still available. If the password changed, then it will popup the dialog to let you enter the new password to sing-in again.

因此,在您的场景中,如果您曾经在当前用户帐户(运行 VS 的 Windows 帐户)下使用 VS2017 连接到 TFS,那么您可以尝试以下方法以另一个用户身份运行 VS2017:

So, in your scenario if you have ever connected to the TFS with VS2017 under current user account (windows account to run VS ), then you can try to below ways to run VS2017 as another user:

  • 以不同的用户身份运行,就像上面提到的 Pankaj 一样.
  • 以其他用户身份运行 Visual Studio 的命令:

  • Run as different user as Pankaj mentioned above.
  • Command to run Visual Studio as another user:

cd C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE

runas/netonly/user:devenv.exe

输入用户密码,然后 Team Explorer > Manage Connections

Enter the user password, then Team Explorer > Manage Connections

如果你坚持使用不同的tfs账号在同一个windows账号下的VS中连接同一个TFS服务器,那么你可以尝试从凭据管理器中删除tfs相关的凭据,清理VS和TFS缓存等...但根据我的测试,很难生效.

If you insist on using different tfs accounts to connect the same TFS server in VS under the same windows account, then you can try to remove the tfs related credentials from Credential Manager, clean VS and TFS caches etc... But based on my test, it's difficult to take effect.

您可以在其他主题中参考我的回答:

You can reference my answers in other threads:

这篇关于VS 2015和VS 2017如何使用不同的账号连接TFS?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆