TFS API not correctly authenticating VSS Credentials RRS feed

  • Question

  • I have the following code:

    Uri tfsUri = (args.Length < 1) ?
                new Uri(sourceUri) : new Uri(args[0]);
                NetworkCredential netCred = new NetworkCredential("email", "password");
                Microsoft.VisualStudio.Services.Common.WindowsCredential winCred = new Microsoft.VisualStudio.Services.Common.WindowsCredential(netCred);
                VssCredentials vssCred = new VssClientCredentials(winCred);
                TfsTeamProjectCollection collection = new TfsTeamProjectCollection(tfsUri, vssCred);

    My intention is for this code to automatically log me in to my Team Foundation Services URL. However, instead of automatically logging me in, whenever I run my program the Visual Studio Login Form appears.

    I would like this to be an automatic process, without requiring manual username/password entry - how would I achieve this?

    Tuesday, September 19, 2017 2:06 PM


All replies