Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

FIX: .NET Framework 4.5-based HttpWebRequest and HttpClient classes terminate server connection in Windows 7 SP1, Windows Server 2008 R2 SP1, Windows Server 2008 SP2 and Windows Vista SP2


View products that this article applies to.

Symptoms

Assume that you use the HttpWebRequest class or the HttpClient class in .NET Framework 4.5 to send a request to the server. In this situation, after the request is made and the HTTP response is chunked, server connection is terminated.

Note This issue typically occurs after you apply the update that is described in the following Knowledge Base (KB) article:
2750147 An update is available for the .NET Framework 4.5 in Windows 7 SP1, Windows Server 2008 R2 SP1, Windows Server 2008 SP2, and Windows Vista SP2: January 2013

↑ Back to the top


Resolution

To make sure that the HttpWebRequest class and the HttpClient class will reuse a connection, you must drain the entire HTTP request responses from the connection before a new request can be made. To deal with this issue, apply one of the following methods:
  • Make sure that you completely drain the response stream before you send a new request. For example, when you receive a chunked response, the application reads the response stream until the read method on the stream returns "0 bytes read." 

    Note This approach requires no additional update to be installed.
  • Install this update to restore the same behavior prior to the installation of the hotfix in KB 2750149. When the application closes the response stream, the HttpWebRequest class tries to drain the responses. If this operation is successful, the connection will be reused for the next request.

Hotfix Information

A supported hotfix is now available from Microsoft. However, it is intended to correct only the problem that this article describes. Apply it only to systems that are experiencing this specific problem.

To resolve this problem, contact Microsoft Customer Support Services to obtain the hotfix. For a complete list of Microsoft Customer Support Services telephone numbers and information about support costs, visit the following Microsoft website:Note In special cases, charges that are ordinarily incurred for support calls may be canceled if a Microsoft Support Professional determines that a specific update will resolve your problem. The usual support costs will apply to additional support questions and issues that do not qualify for the specific update in question.


Prerequisites

To apply this hotfix, you must have Microsoft .NET Framework 4.5 installed.

Restart requirement

You must restart the computer after you apply this hotfix if affected files are being used during the installation. We recommend that you close all applications that use .NET Framework before you apply this hotfix.

File information
The global version of this hotfix has the file attributes (or later file attributes) that are listed in the following table. The dates and times for these files are listed in Coordinated Universal Time (UTC). When you view the file information, it is converted to local time. To find the difference between UTC and local time, use the Time Zone tab in the Date and Time item in Control Panel.

For all supported x86-based versions of Windows 7 SP1, Windows Server 2008 SP2 and Windows Vista SP2
File nameFile versionFile sizeDateTimePlatform
System.dll4.0.30319.190813,450,44007-May-201301:45x86
For all supported x64-based versions of Windows 7 SP1, Windows Server 2008 R2 SP1, Windows Server 2008 SP2 and Windows Vista SP2
File nameFile versionFile sizeDateTimePlatform
System.dll4.0.30319.190813,450,44007-May-201301:45x86

↑ Back to the top


Keywords: kbhotfixserver, kbqfe, kbfix, kbsurveynew, kbexpertiseadvanced, kb

↑ Back to the top

Article Info
Article ID : 2846044
Revision : 1
Created on : 1/7/2017
Published on : 6/13/2013
Exists online : False
Views : 653