c# - TfsConfigurationServer.GetService<VersionControlServer>() always returns null -


i'm trying connect tfs 2010 using tfs sdk, can't versioncontrolserver service.

var servers = registeredtfsconnections.getconfigurationservers(); // ok 

then

var tfs = new tfsconfigurationserver(servers.first().uri, credentialcache.defaultnetworkcredentials); // or var tfs = new tfsconfigurationserver(servers.first()); 

both returns null:

var vc = (versioncontrolserver)tfs.getservice<versioncontrolserver>(); // null! 

what should do?

you don't want configuration server, want project collection. version control service scoped team project collection. example:

var projectcollection =     tfsteamprojectcollectionfactory.getteamprojectcollection(registeredprojectcollection);  var versioncontrol = projectcollection.getservice<versioncontrolserver>(); 

see also: connect project collection


Comments

Popular posts from this blog

Javascript line number mapping -

linux - Mailx and Gmail nss config dir -

c# - Is it possible to remove an existing registration from Autofac container builder? -