So, I have a TFS server at http://mytfsserver:8080. I’m connected to it fine from visual studio doing all the usual TFSy things without any issue at all.
I’m trying to connect from code though – I do the following:
tfs = TfsTeamProjectCollectionFactory.GetTeamProjectCollection(new Uri("http://mytfsserver:8080"));
tfs.EnsureAuthenticated();
But I get a TeamFoundationServiceUnavailableException.
I’m not connecting to my server in any funny ways, so what is different about what I’m doing to what VS does when it connects?
You just need to add the collection name at the end of the Uri