FIX: Connection Problems When You Make a Web Request with WebRequest Class

Article translations Article translations
Article ID: 321831 - View products that this article applies to.
This article was previously published under Q321831
Expand all | Collapse all

On This Page

SYMPTOMS

You may notice significant performance degradation and contention problems under the following circumstances:
  • You use the WebRequest class to make a Web request on a network. -and-

  • You request a Uniform Resource Identifier (URI) with an Internet Protocol (IP) address instead of a host name. -and-

  • The network is without a DNS server. -or-

  • The DNS server is not configured correctly on the network.
You may also experience this problem when you call Web services because your Web service client uses the WebRequest class to call the Web service.

Note You may also receive HTTP 404 errors if the Web request is routed to the wrong site in Microsoft Internet Information Services (IIS).

CAUSE

These contention problems can occur when you use an IP address in the URI because a reverse Domain Name System (DNS) lookup is done.

RESOLUTION

To resolve this problem, obtain the latest service pack for Microsoft .NET Framework. For additional information, click the following article number to view the article in the Microsoft Knowledge Base:
318836 INFO: How to Obtain the Latest .NET Framework Service Pack
The English version of this fix should have the following file attributes or later:
   Date         Time   Version        Size        File name
   --------------------------------------------------------------
   25-Apr-2002  21:25  1.0.3705.266   1,163,264   System.dll
				

WORKAROUND

To work around this problem, you can add the associated host name to the host file. This prevents the reverse DNS lookup to query the DNS server.

STATUS

Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article. This problem was first corrected in Microsoft .NET Framework Service Pack 2 (SP2).

MORE INFORMATION

The following code samples reproduce this problem:
//sync
WebRequest request = WebRequest.Create("http://192.168.0.16/page.aspx");
Stream response = request.GetResponse();

//async
RequestState state = new RequestState();
HttpWebRequest request = (HttpWebRequest)WebRequest.Create("http://192.168.0.16/page.aspx");
state.Request = request;
IAsyncResult response = (IAsyncResult)request.BeginGetResponse(new AsyncCallback(this.MyCallback), state);
				

Properties

Article ID: 321831 - Last Review: September 27, 2005 - Revision: 2.3
APPLIES TO
  • Microsoft .NET Framework 1.1
Keywords: 
kbhotfixserver kbqfe kbbcl kbbug kbfix kbnetframe100presp2fix kbnetframe100sp2fix KB321831

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