Permission error when trying to programatically connect to TFS 2010
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 complet开发者_如何转开发e 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
Make sure you include the project collection on your connection URI (e.g. http://tfs:8080/DefaultCollection
精彩评论