TF31002: Unable to connect to this Team Foundation Server {0}.

You might receive this error when you try to connect to Visual Studio Online or from Visual Studio or Team Explorer to Visual Studio Online or an on-premises Team Foundation Server (TFS).

You receive this error when you try to connect to Visual Studio Online

Problem

Resolution

You don’t have an active account or license.

Check with your account administrator that you’re a member of the account and have an active, valid license. See Assign licenses to users for details.

Your Visual Studio Online account is connected to the Azure Active Directory.

When your Visual Studio Online account is connected to a directory, one that is associated with an Office 365 or Microsoft Azure subscription, only members in the directory can access the account.

Check with your directory administrator to have them create an organizational account for you or add your account to the directory as external member.

You can’t switch between different organizational accounts.

If you work with several Visual Studio Online accounts that connect to different directories, such as accounts that are created from the Microsoft Azure Preview Portal, the sign-out function might not work as expected. For example, you can't switch between different organizational accounts to connect to multiple accounts that are linked to directory tenants.

When this problem occurs, you see a flashing blank sign in dialog box several times. Then, you receive either TF31002 or TF31003 error after you connect to or add a new connection in "Connect to Team Foundation Server" dialog box.

To resolve this problem, apply the most recent update available here: Visual Studio 2013 Update 2.

To learn more, see KB Article ID 2958966.

You want to log into Visual Studio Online from Visual Studio using a different account.

See Connect to team projects: Change accounts when you connect to Visual Studio Online.

You receive this error when you try to connect to an on-premises TFS from your client computer

If you determine that you’re receiving this error from one computer but not others, or others aren’t receiving this error, then check the problem resolutions outlined below.

Problem

Resolution

You’ve entered an incorrect server URL.

Verify that you have typed the server URL correctly, including the server name, port number, and protocol (http/https). Go here to learn more.

The TFS configuration has changed.

If the configuration for the on-premises TFS has changed, you must create a new connection. You might also need to clear the client cache.

You work remotely and need to connect to a TFS Proxy server to check in files to Team Foundation version control.

Configure Visual Studio to connect to TFS proxy server. See Configure Visual Studio to connect to TFS Proxy.

You’re connecting to a later version of TFS than your Visual Studio client version.

Your version of Visual Studio or Team Explorer might be incompatible with Team Foundation Server. You might need to install one or more GDR packs. See Compatibility between Team Foundation Clients and Team Foundation Server for details.

Your firewall is blocking TFS services.

See Allow a program to communicate through Windows Firewall.

Visual Studio stops responding when you run a query in Visual Studio.

Your computer might be configured to bypass the proxy server. You should verify the configuration of the BypassProxyOnLocal setting on your computer. For more information, see How to: Change the BypassProxyOnLocal Configuration.

Several users receive this error when they try to connect to an on-premises TFS

If the problem occurs on more than one computer, you should contact your TFS administrator to confirm whether the server is operational and available on the network.

As an administrator, you should check the event logs for the application-tier server to try to pinpoint the problem. Also, you can use the following table to determine whether the server is misconfigured. Problems that are more likely to occur appear first. Therefore, you should try the resolutions in the order in which they appear so that you increase the chance that you can solve the problem quickly.

Problem

Resolution

The TFSService account password has expired or is incorrect.

Many services for Team Foundation Server will stop running when the service account for Team Foundation has expired. For more information, see Change the Service Account or Password for Team Foundation Server.

The application-tier server for Team Foundation is unavailable.

Verify whether each required service is running. If a required service is not running, you must restart it. If necessary, set it to start automatically. For more information, see Stop and Start Services, Application Pools, and Websites.

The network is unavailable.

Verify whether your network is operational.

A website identity for Team Foundation is configured incorrectly.

Verify or correct the server binding assignments that are made to websites for Team Foundation. For more information, see How to: Verify or Correct Server Binding Assignments.

Access to a website for Team Foundation has been restricted.

Verify or correct restrictions that are made to those websites that are based on IP addresses and domain names. For more information, see How to: Verify or Correct IP Address and Domain Name Restrictions.

The firewall or ports are configured incorrectly.

Verify or correct port binding assignments for websites and port assignments for the firewall. First, you should open the administration console for Team Foundation, display the Application Tier page, and review the URL assignments. If necessary, you can choose Change URL to modify the URL of a website. Next, you should verify the port assignments for Internet Information Services (IIS) and the ports that are allowed through the firewall. For more information, see Review Server Status and Settings and How to: Verify or Correct Port Assignments.

Trust relationships between domains are not configured correctly.

If a group of users cannot access Team Foundation Server, you might have trust issues between domains. For more information, see Trusts and Forests Considerations for Team Foundation Server.

When users connect to different versions of TFS from Visual Studio, for example, they connect to TFS 2012 and then TFS 2008, they can get the TF31002 error.

This can occur because the GUIDs for the TFS 2012 collection are the same as the GUIDs for TFS 2008. This confuses the local client cache, which tries to maintain the same GUID based local cache for both the 2008 server and the new Project Collection in 2012.

To fix this, run the TFSConfig ChangeServerID command. See ChangeServerID Command.

If the previous resolutions do not solve the problem, see MSDN Forums - Visual Studio Team System – Team Foundation Server - Administration.