.NET 2.0 HttpWebRequest does not use the https Proxy from Internet Explorer Settings

The .NET framework version 2.0 has the ability to get the IE proxy Settings and use them when making a WebRequest.  However it only will read the http static proxy and not use the https value when specified.  See this example: I would expect this code to return http://secureproxy:8080 for the proxy when I specify …

2

How to get a dump for a System.Net.WebException using DebugDiag (Debug Diagnostics)

This information is available in the help file as well.  For more options please refer to the Help Documentation include with DebugDiag. Install the latest Debug Diagnostics from http://download.microsoft.com (search for Debug Diagnostics once on that site) Configure a crash rule for all w3wp.exe processes (if this dialog does not appear simply press the ‘Add…

0

Using HttpWebRequest with Credential Manager

A little know fact is that the .NET framework will use the stored credentials in the Credential Manager when accessing a network resource if the credentials exist for that particular resource (host).  I intend to clear up how this functionality works for the HttpWebRequests (you could extend this to WebService calls as well). In Internet…

7

Web Service call results in Exception: A socket operation was attempted to an unreachable host

There can be many reasons for this error.  In some cases this error can be confusing.  I have seen a few instances where an ASP.Net webservice call resulted in this error.  More perplexing is the fact that Internet Explorer on the same machine can reach the WebService fine.  If a firewall was blocking the traffic, most…

0

Understanding MaxServicePointIdleTime and DefaultConnectionLimit

To understand these settings you need to understand how the HttpWebRequest class relates to the ServicePointManager and ServicePoint classes.  When you make a request with the HttpWebRequest class, the ServicePointManager provides a ServicePoint object to the HttpWebRequest object to handle the connection to a web resource (web server).  This ServicePoint object manages all the requests…

11

HttpWebRequest exception: "Unable to connect to the remote server" when using .INS config files

Problem  Taking a System.Net Trace (see My Favorite System.Net Tracing File) you will see that the HttpWebRequest is trying to use a .INS file. System.Net Verbose: 0 : [0371] WebRequest::Create(http://myserver/ie/update/windows/IEConfig.INS) It is successfully retrieved but when the request is made you see something similar to this in the .NET log: System.Net.Sockets Error: 0 : [0371]…

3

My Favorite System.Net trace configuration file dumps Process ID and Date Time Information

Often you need to correlate a .NET trace with a Netmon trace.  To do that you need the date and time of the call from the System.Net trace.  This will do it! NOTE:  This section is configures where the log file is and where it should be written: initializeData="System.Net.trace.log" Specify the path and file name…

3

HttpWebRequest WebExcepton: The remote server returned an error: (407) Proxy Authentication Required.

Problem System.Net Tracing (see My Favorite System.Net Tracing File) revealed that we are getting the 407 error and the .NET framework is not retrying the request with Credentials.  System.Net Error: 0 : [4811] Exception in the HttpWebRequest#33574938:: – The remote server returned an error: (407) Proxy Authentication Required.  We can see in a Fiddler2 trace that…

7

Anaylyze HttpWebRequest Hangs with a VB DebugDiag script`

Here is a VB Version of the JScript DebugDiag script for analyzing WebRequest hangs using DebugDiag http://blogs.msdn.com/jpsanders/archive/2008/10/24/analyzing-httpwebrequest-connection-saturation-in-net.aspx.  It has several improvements over the previous version.  First you will notice many similarities to the previous script.  Some minor changes were added to translate from Jscript to VBscript.  One big change is the .loadby command.  This will…

0