1
我有控制檯程序,它需要從源代碼控制(本地tfs 2012)下載文件。但是當我嘗試初始化VersionControlServer時,我在調試中看到,這個變量等於null。你能幫我解決這個錯誤嗎?不初始化tfs版本控制服務器
TfsTeamProjectCollection teamProjectCollection = TfsTeamProjectCollectionFactory.GetTeamProjectCollection(new Uri(UrlSite));
VersionControlServer versionControlServer = teamProjectCollection.GetService<VersionControlServer>();
versionControlServer.DownloadFile(serverPath, localFile);//throw exception, because versionControlServer=null;