27
votes

When I open my existing solution in Visual Studio 2012 professional, I got the above error. This used to work but something messed up after the computer is rebuilt.

I have installed Visual Studio 2015 Community and can connect to the same collection correctly.

I also tried to use a browser to connect to the same collection. It works fine also.
Cleaning all files in AppData\Local\Microsoft\Team Foundation\4.0\Cache does not work.
It should not be a firewall or proxy issue since Visual Studio 2015 works.
Anyone knows what is wrong with Visual Studio 2012 and how to fix it?

Edit:

This error can happen with later versions of TFS:

Team Foundation Error

TF400324: Team Foundation services are not available from server TFSServer\DefaultCollection.

Technical information (for administrator):

Unable to connect to the remote server

A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond xxx.xxx.xxx.xxx:443

10
What version of TFS are you connecting to? Has anything changed on TFS recently? Is your VS2012 fully service packed (update 5)?DaveShaw
@DaveShaw, thanks for your questions. The version of TFS on server is 11.0.51106.1. Nothing has been changed on server side, but my dev machine has been rebuilt on client side. My VS2012 has been in Version 11.0.61219.00 update 5.Don

10 Answers

27
votes

According to this blog the solution is (and Yes it worked for me)

  1. Close all instances of Visual Studio
  2. Open the Task Manager and check if any TFS Services are running.
    Select each of them and click on End Process Tree
    (in my case I did not find any of them to End)
  3. Browse to the folder %LocalAppData%\Microsoft\Team Foundation\
    and then select the folder with your TFS version and go inside the Cache folder.
    for example, in my machine the path was %LocalAppData%\Microsoft\Team Foundation\7.0\Cache and it should be the same on your machine with the difference of the TFS version folder name.
  4. Delete everything in that Cache folder.
  5. Start Visual Studio and build the project
7
votes

I got this error in TFS2017. For me the problem was a Self-Signed Certificate.

Open the TFS URL in IE and you will see a Red Address Bar:

enter image description here

Click the "Certificate Error" in the address bar:

enter image description here

Then select "View Certificates":

If clicking "View Certificates" doesn't work, right click on page > Properties > Certificates.

enter image description here

If the Install Certificate button is hidden to make it visible you will have to Open Internet Explorer Options > Security > Sites > type the TFS server URL > Tick Require server verification > click Add. (If the dialog is disabled see the guide Trusted Sites Dialog is Disabled at the end of this answer).

enter image description here

Once you have the install certificate button available, select “Install Certificate”.

enter image description here

This will launch the Certificate Import Wizard. Make sure to Choose the option “Place all certificates in the following store” and select browse.

enter image description here

Select Trusted Root Certification Authorities and click Ok.

enter image description here

Click Finish on Completing the Certificate Import Wizard:

enter image description here

Click yes on the security warning to install the certificate.

enter image description here

=================================================

Trusted Sites Dialog is Disabled

You can check to see if the site is Trusted, on Windows 7 the path is: HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMapKey

The key should contain several string values with a name indicating the URL and numeric data indicating the zone, one of the following by default.

  • 0 = My Computer
  • 1 = Local Intranet Zone
  • 2 = Trusted sites Zone
  • 3 = Internet Zone
  • 4 = Restricted Sites Zone

If the TFS site is not listed in the registry then add it manually. Restart Visual Studio and try to connect to the TFS server again from Visual Studio. Once you can connect you can also remove the TFS server from the Connection List. I suggest removing it and adding the FQDN url which will most likely already have a Trusted Site rule.

Edit

Hit this again. This time it was caused by a problem with a network card that was replaced on the weekend by our telecommunications provider.

3
votes

This issue is happening when server is not responding, In my case server hosting TFS was down, we restarted and get connected.

2
votes

Try clear both local TFS cache and Visual Studio Cache

clear visual studio cache under

%APPDATA%\Microsoft\VisualStudio

clear TFS cache under

%LocalAppData%\Microsoft\Team Foundation
1
votes

...better late than never...
I just had a user run into same error TF400324 connecting VS2012 to TFS2015 (hosted in a virtual private cloud). TFS Web Access worked fine for her, but Visual Studio 2012 UI was stuck in offline connection.

FIX: She managed to get VS connected again after clicking Team Explorer > Connect | {TeamProject}, Then select desired Team Project below the TFS Server connection (see screenshot attached).

NOTES:
I suspect clearing client-side TFS cache might also fix, but all VS instances would need to be closed then "Connect to Team Project Connection" re-established. Just disconnecting and reconnecting VS to TFS did not clear the "offline" state.

Error she saw was in VS output window:

This solution is offline. [Team Foundation Server: {//TFS Collection URL}] The solution was offline during its previous session and will remain offline. TF400324: Team Foundation services are not available from server . Technical information (for administrator): Page not found.

NOTE: I recently moved TFS to different domain requiring SSH connection and localhost port mapping. I have users going offline much more frequently due to different proxy routing depending on whether they are at work or connected more directly to the Internet.

Screenshot: VSTE Reconnect to offline project

1
votes

For me the fix was simply running Visual Studio (2010) as an administrator.

0
votes

In my case, my company VPN my Host machine was connected to was preventing me to access the tfs on a VirtualBox VM, returning this exact error message.

0
votes

We solved it by adding a specific exclusion to ESET / Kaspersky AntiVirus for the devenv.exe "C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\devenv.exe"

Its been working great ever since.

I get basic idea from this link

0
votes

Soluton for me was to run the standalone TFS installation. This is for 2017, but worked to fix my VS2019.

https://visualstudio.microsoft.com/thank-you-downloading-visual-studio/?sku=TeamExplorer&rel=15

Bit of background...

I'd been having this issue since 2017. Tried all the usual suggestions on here, cache clearing, config file editing etc. but would always have to come off my organisation's network to check code in, as it was proxy related. TFS was trying to connect to a proxy server ip that had been decommissioned, no one from the service desk could work out why. Couldn't find any reference to this old ip in any config files.

Installed VS2019 hoping it would solve the issue but it persisted. Eventually I thought of trying to uninstall it as a component and re-installing it. Couldn't find a way to do that but in my search I found the standalone installer for Team Explorer, albeit for VS2017.

After installing, I ran this, opened up Manage Connections in the Team Explorer connections page and did what I needed to connect to the repository from there. Worked first time. Closed Team Explorer 2017, opened my VS2019, and everything seemed fine in there as well.

Amazed my problem is finally solved!

0
votes

This error is usually related to the TFS cache. Before you clear the cache folder, please make sure you have closed all instances of Visual Studio and also try to open Task Manager and check if any TFS Services are running. Select each of them and click on End Process Tree.

And also clear the server cache Server cache, the path like C:\ProgramData\Microsoft\Team Foundation\Web Access

Then restart Visual Studio and run as Administrator Mode.

More details you can refer this blog (archived version at the bottom) and also could try the better fix.

Note: Make sure you are working on a different workspace rather then VS2015's.