Microsoft Knowledge Base Email Alertz

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

Search KbAlertz

Advanced Search

Receive Microsoft Knowledge Base articles by E-Mail?

Every night we scan the Microsoft Knowledge Base. If technologies you're interested in are updated, we'll send you an e-mail. You only get one e-mail a day, and only when new articles are added.

Click here to create a
FREE account
Already have an account?
[Click here to Login]











Microsoft Knowledge Base Article

This article contents is Microsoft Copyrighted material.
©2005-©2007 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks

Article ID: 976816 - Last Review: September 15, 2010 - Revision: 4.0

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

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 (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.


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
       

Community Feedback System

Very often, it takes hours to solve a problem. Very often, you've looked high and low, and have tried a lot of solutions. When you finally found it, chances are, it was because someone else helped you. Here's your chance to give back. Use our community feedback tool to let others know what worked for you and what didn't.

Please also understand that the community feedback system is not warranted to be correct, it's simply a system that we've built to let people try and help each other. If something in a feedback response doesn't make sense to you, or you're not comfortable making changes that the feedback talks about (like registry edits), please consult a professional.

Thank you for using kbAlertz.com Feedback System.

-- Scott Cate