I am connecting to TFS using the followi开发者_StackOverflow社区ng code, Can someone guide me on which API I should so that I dont have to provide user name , domain and pass.
Application should pick the windows credential through which I have logged in to the system.
TeamFoundationServer tfServer = new TeamFoundationServer(@"domain", new NetworkCredential("username", ","password", "domain"));
tfServer.Authenticate();
I see this has already been answered, however, you can just omit the network credentials, and it will use the currently logged-in user. e.g.:
var TfsServer = new TeamFoundationServer("http://tfs:8080");
Try using System.Net.CredentialCache.DefaultNetworkCredentials? Assuming you are on the same domain.
精彩评论