It may also be observed that an application targeting the .NET Framework 4.0 using Automatic Proxy Detection is slower than the same application that targets the .NET Framework 3.5, .NET Framework 3.0, or .NET Framework 2.0.
This problem can occur when a Proxy Auto-Configuration (PAC) file is deployed in the environment and the application is using the Automatic Proxy Detection using the .NET Framework.
The methods in the System.Net.HttpWebRequest and related classes in .NET Framework 4.0 were migrated to use the same proxy detection mechanism used by other Windows components. This mechanism uses functions in the native WinHTTP API to retrieve the proxy file, download the proxy script, parse the script, and execute the necessary commands. The proxy script may require resolving DNS addresses, determining the local computer's IP addresses, and determining the local networks. The WinHTTP APIs determine the local IP addresses by querying the local computer for information on all network adapters. This is an expensive operation which may take a considerable amount of time to complete. In addition, depending on the commands in the proxy scripts, this operation to determine the local IP addresses can be repeated several times, adding further time delays.
The internal mechanism used in .NET Framework 3.5, .NET Framework 3.0, and .NET Framework 2.0 uses an internal proxy detection which may be considerably faster depending on the proxy script. The internal mechanism determines the local IP addresses initially and then registers for network change notifications. As long as the network configuration doesn't change while the proxy file is being executed, the overhead to determine the local IP addresses occurs only once. So the time spent in determining local IP addresses can be much lower depending on the commands in the proxy script.
Examples of commands which should be used conservatively in the Proxy Auto-Configuration (PAC) script are:
Artikelnummer: 2583681 – Letzte Überarbeitung: 19.07.2011 – Revision: 1