Web requests take a long time to be completed when you call the System.Net.HttpWebRequest class to create the requests in a .NET Framework 2.0-based application

Article translations Article translations
Article ID: 976816 - View products that this article applies to.
Expand all | Collapse all

On This Page

SYMPTOMS

In a Microsoft .NET Framework 2.0-based application, you call the System.Net.HttpWebRequest class directly or indirectly to create a Web request. However, the request takes a long time to be completed. For example, the Web request may take two times as long as usual to be completed.

Note The following are two examples in which you call the System.Net.HttpWebRequest class indirectly:
  • You use an HTTP channel in the System.Runtime.Remoting.Channels.Http namespace.
  • You use an HTTP transport that is based on Windows Communication Foundation (WCF).

CAUSE

This problem occurs because two requests are assigned to the same connection at the same time even when an idle connection is available. Therefore, requests that are usually completed very quickly may be blocked in a queue behind other requests even when other connections are available.

RESOLUTION

Hotfix information

You can download this hotfix rollup from the following Microsoft Connect Web site:
http://connect.microsoft.com/VisualStudio/Downloads/DownloadDetails.aspx?DownloadID=31248

Prerequisites

You must have the .NET Framework 2.0 Service Pack 2 (SP2) or the .NET Framework 3.5 Service Pack 1 (SP1) installed to apply this hotfix.

Restart requirement

If no instance of the .NET Framework is being used when you apply this hotfix, you do not have to restart the computer.

Hotfix replacement information

This hotfix does not replace other hotfixes.

File information

The English 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 Server 2003 SP2
Collapse this tableExpand this table
File nameFile versionFile sizeDateTimePlatform
System.dll2.0.50727.44183,149,82 403-Nov-200905:34x86

For all supported x64-based versions of Windows Server 2003 SP2
Collapse this tableExpand this table
File nameFile versionFile sizeDateTimePlatform
System.dll2.0.50727.44183,149,82 403-Nov-2009 05:07x64

For all supported IA-64-based versions of Windows Server 2003 SP2
Collapse this tableExpand this table
File nameFile versionFile sizeDateTimePlatform
System.dll2.0.50727.44183,149,82403-Nov-2009 05:07IA-64
For all supported x86-based versions of Windows Vista SP2 and Windows Server 2008 SP2
Collapse this tableExpand this table
File nameFile versionFile sizeDateTimePlatform
System.dll2.0.50727.44173,149,82412-Nov-200912:25x86
For all supported x64-based versions of Windows Vista SP2 and Windows Server 2008 SP2
Collapse this tableExpand this table
File nameFile versionFile sizeDateTimePlatform
System.dll2.0.50727.44173,149,82412-Nov-200912:24x64
For all supported IA-64-based versions of Windows Server 2008 SP2
Collapse this tableExpand this table
File nameFile versionFile sizeDateTimePlatform
System.dll2.0.50727.44173,149,82412-Nov-200912:23IA-64
For all supported x86-based versions of Windows 7
Collapse this tableExpand this table
File nameFile versionFile sizeDateTimePlatform
System.dll2.0.50727.50193,182,59203-Jun-201022:45x86
For all supported x64-based versions of Windows 7 and Windows Server 2008 R2
Collapse this tableExpand this table
File nameFile versionFile sizeDateTimePlatform
System.dll2.0.50727.50193,182,59203-Jun-201022:42x64
For all supported IA-64-based versions of Windows Server 2008 R2
Collapse this tableExpand this table
File nameFile versionFile sizeDateTimePlatform
System.dll2.0.50727.50193,182,59203-Jun-201022:40IA-64

STATUS

Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.

MORE INFORMATION

Typically, the System.Net.HttpWebRequest class opens connections to remote endpoints (defined by an IP address and a port number) from a pool of connections that is managed by an instance of the System.Net.ServicePoint class. If many requests are made, the connections in the pool may all be assigned to instances of the System.Net.HttpWebRequest class. Therefore, new instances of the System.Net.HttpWebRequest class are assigned to connections that are already being used. In this situation, a new request can start to be processed only after the first request that was sent is completed.

This problem occurs in the time interval after a connection is assigned to a Web request and before the connection is used. During this time interval, the connection is reassigned to another Web request even when an idle connection is available. After you apply this hotfix, connections are marked as "reserved" immediately after they are assigned to Web requests. Therefore, these connections cannot be assigned to other Web requests.

Properties

Article ID: 976816 - Last Review: September 15, 2010 - Revision: 4.0
APPLIES TO
  • Microsoft .NET Framework 2.0
  • Microsoft .NET Framework 2.0 Service Pack 1 (x86)
  • Microsoft .NET Framework 2.0 Service Pack 2
  • Microsoft .NET Framework 3.5 Service Pack 1
Keywords: 
kbexpertiseadvanced kbsurveynew kbqfe KB976816

Give Feedback

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com