即使清除缓存并从凭据管理器中删除,VS仍会记住TFS凭据 [英] VS remembers TFS credentials even after clearing cache and deleting from Credential Manager

查看:583
本文介绍了即使清除缓存并从凭据管理器中删除,VS仍会记住TFS凭据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我写了一个小的Winform程序来连接TFS。
我的问题是,即使我输入了错误的凭据,我也总是能够成功连接到TFS,但是,在调试模式下,我仍然看到使用了我的实际凭据。

I wrote a small Winform program that connects to TFS. My problem is that i always succeed to connect to TFS, even when i write the wrong credentials, still, in debug mode i see that my actual credentials are used.

I看到了一个类似的问题 并按照建议的操作,从凭据管理器中删除了我的TFS凭据,仍然没有运气(是的,我确实退出并重新打开了VS)。
我还注销了TFS本身,并删除了Visual Studio上的连接。
另外,我按照建议此处

I saw a similar question here and did exactly as suggested, deleted my TFS credentials from Credential Manager, still no luck(Yes, i did exit and re-open VS). I also logged out ot TFS itself and removed the connection on visual studio. Also, i deleted the cache folder as suggested here.

我的代码如下所示:

folderPath=@"$/TFS_PATH";
            
cred = new NetworkCredential(ConfigurationManager.AppSettings["user"], ConfigurationManager.AppSettings["pass"]);

tfs = new TeamFoundationServer("CollectionPath", cred);

tfs.EnsureAuthenticated();
            
MessageBox.Show("tfs.EnsureAuthenticated() succeeded");

代码的某些植入物:

cred是NetworkCredential的一个实例

cred is an instance of NetworkCredential

tfs是TeamFoundationServer的实例

tfs is an instance of TeamFoundationServer

用户名和密码在app.config中。不知何故,它完全忽略了它,并使用了我的真实凭据。

The username and password are in app.config. Somehow, it completely ignores it, and uses my real credentials.

有人知道我还能做什么吗?我的目标是仅通过app.config中存储的用户名和密码来启用任何计算机/服务器的TFS连接,而不依赖于已存储在计算机本身中的凭据。

Does anyone know what else can i do? My goal is to enable the TFS connection from any computer/server by the username and password that are stored in app.config ONLY, not depend on the credentials that are stored on the machine iteself already.

谢谢

推荐答案

问题是我没有与VS断开连接。
仅仅删除连接是不够的。
我需要验证是否已注销:打开VS,单击连接到Team Foundation ...,然后在弹出窗口的左下方单击注销。
就是这样。

The problem was that i wasn't properly disconnected from VS. Removing the connection wasn't enough. I needed to verify that i signed out: Open VS, click on "Connect to Team Foundation..." and then click "sign out" on the bottom left in the popup window. That's it.

这篇关于即使清除缓存并从凭据管理器中删除,VS仍会记住TFS凭据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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