Using VS 2003.NET with C#, IE 6.0.2900.2180, WinXP Pro with all current updates from windowsupdate....
In IE, Tools->Options->Connections->LAN Settings, I have "use a proxy.." turned on, and the address manually set (in this case, to 192.168.0.133, port 80)
In my 1.1 machine.config: <proxy usesystemdefault="true"/>
(I haven't changed machine.config whatsoever - so this is default)
I then execute the following code in a form:
WebProxy myProxy;
myProxy = WebProxy.GetDefaultProxy();
MessageBox.Show("The actual default Proxy settings are " + myProxy.Address);
I'm expecting that "myProxy.Address" is "http://192.168.0.133:80". However, it's actually coming up as blank (or 'undefined' in the debugger.) If I create a new HttpWebRequest, the request's Proxy property also does initialize itself from IE's proxy settings.
This is only a symptom of a larger problem I'm having: I've written a .net component which runs untrusted within IE. Being it's untrusted (and designed to stay untrusted), I can't prompt for and configure a proxy setting manually (no permissions...) The result is that while the component will download from the web server via the proxy, any web requests that the component itself makes will fail (timeout, usually) if the machine is set up to use a proxy server.
At this point, changing the component to use .NET 2.0 isn't an option (at least not until VS2005 is released gold.)
Any assistance in this matter would be appreciated
Thanks
Gary

.net 1.1, WebProxy.GetDefaultProxy() not functioning
PeterSanDiego
Can you please provide additional details on the error you are seeing with your default code:
- Is an exception thrown
- Are you seeing the problem on multiple verions of Windows
- Which security update are you referring to
Mike Flasko
PM System.Net
CSomercik
GlobalProxySelection.Select = myProxy.GetDefaultProxy
GlobalProxySelection.Select.Credentials = CredentialCache.DefaultCredentials
This worked fine up to the security update. Using a different feature of the Aggregator to enter proxy server details manually fixed the problem.
Andy Henderson
hoabinh
It works for me when I run it from 1.1. Are you seeing this problem when you run your component from an ASPX file If thats the case then you need to be setting the proxy for the user under which IIS runs in as thats the "user account" the framework will look up.
Is that what you are seeing
Mahesh