问题
I have VS2012 and VS2010 on the same machine. VS2012 is connected to Team Foundation Server (now VSOL/Visual Studio Online) but, VS2010 gives below error when trying to add Team Foundation Server (now Visual Studio Online) to the list.
TF31002: Unable to connect to this Team Foundation Server Possible reasons for failure include:
-The name, port number or protocol for TFS is incorrect.
-The team foundation server is offline.
-Password has expired or is incorrect.
For further information, contact Team Foundation Server administrator.
回答1:
I believe VS2010 requires VS2010 Service Pack 1 and a compatibility patch (http://www.microsoft.com/en-us/download/details.aspx?id=29082) to connect to TFS 2012. Do you have those?
回答2:
To fix this, you need to run the TFSConfig command with the ChangeServerID parameter as follows:
1) Open elevated command prompt and change current directory to c:\Program Files\Microsoft TeamFoundation Server 12.0\Tools
2) Execute “TfsServiceControl.exe quiesce”
3) Execute tfsconfig changeserverid /sqlinstance: /DatabaseName:Tfs_Configuration /projectcollectionsonly .
Make sure to pass projectcollectionsonly parameter.
4) Execute “TfsServiceControl.exe unquiesce”
回答3:
This can happen when you have done a full scan(Anti -Virus) to your laptop -> TFS work space don't connect to the TFS server and gives TF31002: Unable to connect to this Team Foundation Server Error.
Reason: Full Anti-Virus scan to a machine un-mounts and mounts the network drives, which leads to breaks the mapping of local drive to the TFS server path.
Solution: 1. Clear the cookies in following path c:\Users\jekumar\AppData\Roaming\Microsoft\Windows\Cookies 2. If it still doesn’t help a. Disconnect from Team Foundation server ( VS IDE -> Team-> Disconnect from Team Foundation Server) b. Rename the locally mapped folders c. Now connect to Team Foundation server ( VS IDE -> Team-> Connect to Team Foundation Server)
来源:https://stackoverflow.com/questions/20231221/tf31002-unable-to-connect-to-this-team-foundation-server-for-vs-2010-vs-2012-i