Caves Travel Diving Graphics Mizar Texts Cuisine Lemkov Contact Map RSS Polski
Trybiks' Dive Texts Programming TFS - The underlying connection was closed: an unexpected error occurred on a receive. YAC Software
  Back

List

Charsets

Charts

DBExpress

Delphi

HTML

Intraweb

MSTest

PHP

Programming

R

Rhino Mocks

Software

Testing

UI Testing

VB.NET

VCL

WPF

TFS - The underlying connection was closed: an unexpected error occurred on a receive.
Are you getting the following (a bit condescending) error message when trying to connect with Visual Studio to TFS (Team Foundation Server)?

Team Foundation services are not available from server x.y.z.
Technical information (for administrator): The underlying connection was closed; An unexpected error occurred on a receive.

Searching for the solution on the net, the first (and only, really) suggestion I found was to add trace listeners to Visual Studio's .config file (system.diagnostics); this, unfortunately, didn't show anything interesting; no error information, no nothing.

But then I remembered we just had similar issues with our WCF services returning a similar message when trying to connect through Squid proxy servers. Not really sure if VS and TFS use WCF services to connect, but I figured it wouldn't hurt to try the solution described there.

Steps to fix:
  1. Go to c:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\
    (or whatever is the version of VS that you have; and ...\Program Files\... on 32-bit systems)
  2. Open file devenv.exe.config in a text editor
  3. Find section <system.net>
  4. Add this entry: <servicePointManager expect100Continue="false" />
    to the <settings> sub-section; the whole section should then look something like this:
      <system.net>
        <settings>
          ... (other settings)
          <servicePointManager expect100Continue="false" />
        </settings>
      </system.net>
  5. Restart Visual Studio
Try connecting now - worked for me.

HTH

Top

Comments
#1
OK wrote on 2015-06-21 13:18:22
Worked for me! Struggled for hours when connection to TFS suddenly stopped working.
Thanks!
#2
German wrote on 2016-12-02 17:08:49
THANKS!!! Worked for me... thanks!!!
#3
Mahendren wrote on 2019-05-31 07:43:33
Worked For me after a long strugle
#4
Manuel Colorado wrote on 2021-09-17 16:54:55
Still worked for VS 2019 in the year 2021

Top

Add a comment (fields with an asterisk are required)
Name / nick *
Mail (will remain hidden) *
Your website
Comment (no tags) *
Enter the text displayed below *
 

Top

Tags

Programming


Related pages

WCF - The underlying connection was closed: an unexpected error occurred on a receive.

Saving / restoring window placements in .NET

Meaningful identifiers

Public fields vs. properties

A Case for FreeAndNIL

Random()'s Determinism

Rounding and precision on the 8087 FPU

Controlling Conditional Defines and Compilation Switches

Registering Extensions

Accessing Protected Members