3

I'm trying to connect to TFS 2010 through the .Net Microsoft.TeamFoundation.Client.TeamFoundationServer class (in this case through powershell).

I pass in for constructor arguments the same url that I connect to through visual studio, and my Active Directory credential obtained through Security.Principal.WindowsIdentity.GetCurrent(). However when I call the Authenticate() method I get the following error (sub DOMAIN and USERNAME for my credentials).

Exception calling "Authenticate" with "0" argument(s): "TF50309: The following account does not have sufficient permissions to complete the operation : (DOMAIN)\(USERNAME). The following permissions are needed to perform this operation: View collection-level information."

So yes, I can go bug our sysadmin for whatever this permission is but I have no idea why I need it; after all, I can connect to TFS just fine via visual studio, or via the web interface (by suffixing the url with "/web") so what gives? What am I missing that I cannot authenticate programatically?

Extra Hint: We also have a TFS2008 server - following the exact same process I was able to authenticate to it with no problems

riQQ
  • 9,878
  • 7
  • 49
  • 66
George Mauer
  • 117,483
  • 131
  • 382
  • 612
  • 1
    Do you use dlls from Team Explorer 2008 or 2010 to connect to your server? If it's 2008, you need the dlls from the "Foward Patch" (allow 2008 client to connect to 2010 server). – Kipotlov Dec 17 '10 at 17:16
  • Another point : What connection string do you use to connect to your server? In 2010, ther are "Project collection" so the connection string isn't the same that 2008. – Kipotlov Dec 17 '10 at 17:23

1 Answers1

4

Make sure you include the project collection on your connection URI (e.g. http://tfs:8080/DefaultCollection

Robaticus
  • 22,857
  • 5
  • 54
  • 63
  • how does it work if the collection name has spaces in it? %20 ? – George Mauer Dec 17 '10 at 19:44
  • 1
    When you create the URI using `Uri x = new Uri("http://tfs:8080/Default Collection")` it should automatically URLEncode that for you with the %20, so just keep the space in. – Robaticus Dec 17 '10 at 20:20
  • I had a similar problem, connecting through the commandline TfsBuild.exe and had left the top level Team-Project-Collection off, doh! Thanks +1 – SDK Apr 18 '13 at 08:22