简体   繁体   中英

How can I run TFS command lines against my Visual Studio Team Services projects?

I host my projects on Visual Studio Team Services cloud TFS. I'm trying to run some TFS command lines (specifically this ) but I'm not getting very far. I believe the problem is most likely the format of the URL. My command looks like this (linebreaks added for readability):

C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE>
tf status itemspec
/collection:"http://MYACCOUNT.visualstudio.com/DefaultCollection"
/login:MYEMAIL

The error I get in response looks like this:

TF31002: Unable to connect to this Team Foundation Server:
http://MYACCOUNT.visualstudio.com/DefaultCollection.
Team Foundation Server Url:
http://MYACCOUNT.visualstudio.com/DefaultCollection.

Possible reasons for failure include:
- The name, port number, or protocol for the Team Foundation Server is incorrect .
- The Team Foundation Server is offline.
- The password has expired or is incorrect.

Technical information (for administrator):
The remote server returned an error: (404) Not Found.

I've tried it with my password too, but the response is no different. I found this but it did not help me at all. Has anyone been able to run commands against TFS on Visual Studio Team Services?

Please double check the URL. All URLs for Visual Studio Team Services are https , not http . At a minimum, your project collection URL should be:

https ://MYACCOUNT.visualstudio.com/DefaultCollection

If you are using https as Ed mentions, then you are failing to authenticate. Don't use the /login option. Tf.exe will pop up the same authentication dialog as VS does when connecting to your Team Services account. You would need to log in with your Microsoft Account (unless you have Azure Active Directory linked to your Team Services account, and then it is your AAD identity). I ran tf.exe on my work account to double check, and I was able to sign in (two factor auth required in my case - all handled by the auth dialog and I did not use the /login option).

I had the same problem before but I got the solution here . Hope it helps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM