2
我有一个控制台应用程序,需要从源代码管理(TFS)下载一些文件。但是在使用下面的代码时,VersionControlServer
服务为空。由于这个原因,我无法下载我需要的文件。无法从TFS获取VersionControlServer服务
TfsTeamProjectCollection tpc = TfsTeamProjectCollectionFactory.GetTeamProjectCollection(new Uri(UrlSite));
tpc.EnsureAuthenticated();
bool hasAuthenticated = tpc.HasAuthenticated; // true
var versionControl2 = tpc.GetService<VersionControlServer>(); // null
var buildServer2 = tpc.GetService<IBuildServer>(); // successful initialization
var workItemStore2 = tpc.GetService<WorkItemStore>(); // successful initialization
没有。这不行! – user3231442
什么部分不起作用?你有没有找到你的URL到tfs DefaultCollection并在第一行设置? – Shiv