如何从代码中退出TFS 2012(云)?
尝试了一些事情,但身份提供商总是加载相同的凭据。
更新 我试过的一些代码
ClientCredentials tfsClientCredentials = new TfsClientCredentials(false);
TfsConfigurationServer serverConfig = new TfsConfigurationServer(uri, tfsClientCredentials);
serverConfig.EnsureAuthenticated();
和第二个片段
TfsConfigurationServer serverConfig = new TfsConfigurationServer(uri, new UICredentialsProvider());
serverConfig.EnsureAuthenticated();
和第三个
ICredentialsProvider provider = new UICredentialsProvider();
WindowsCredential wcred = new WindowsCredential(cred, provider);
TfsClientCredentials tfsClientCredentials = new TfsClientCredentials(wcred);
TfsConfigurationServer serverConfig = new TfsConfigurationServer(uri, tfsClientCredentials);
serverConfig.EnsureAuthenticated();