We have recently upgraded to VS 2017 and Visual Studio Team Services.
We have a set of automated tools that perform various source control related tasks on behalf of developers.
Some users and one service account appear to have cached credentials somewhere and do not get prompted for credentials when running the tools.
However, other users get prompted for credentials.
I created a mini test app to illustrate the issue. NOTE: The VSTS dlls are the version 15.x files from the VS2017 Team Explorer installation folder. They are also available as part of the Microsoft.TeamFoundationServer.ExtendedClient NuGet package if you don't mind the bloat.
using System;
using Microsoft.TeamFoundation.Client;
using Microsoft.TeamFoundation.VersionControl.Client;
namespace VSTSTest
{
class Program
{
static void Main(string[] args)
{
try
{
if (args.Length > 0)
{
var projectCollectionUrl = args[0];
var projectCollection = new TfsTeamProjectCollection(new Uri(projectCollectionUrl));
var versionControlServer = (VersionControlServer)projectCollection.GetService(typeof(VersionControlServer));
Console.WriteLine("AuthorizedUser: {0}", versionControlServer.AuthorizedUser);
}
Console.WriteLine("Usage is {projectCollectionUrl}");
}
catch (Exception e)
{
Console.WriteLine(e);
}
Console.ReadLine();
}
}
}
This works for some users but not for others and I am trying to find out why.