I am settings proxy pac file using c#,
I understand that I need to set values in
HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Connections\DefaultConnectionSettings
and in
HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Connections\AutoConfigUrl
And then call
InternetSetOption(IntPtr.Zero, INTERNET_OPTION_SETTINGS_CHANGED, IntPtr.Zero, 0);
InternetSetOption(IntPtr.Zero, INTERNET_OPTION_REFRESH, IntPtr.Zero, 0);
My problem is that after I call the InternetSetOption I see that the AutoConfigUrl is deleted, and the pac file is not set.
Anyone knows why it is deleted? and what can I do to set it correctly?
EDIT: Just found out that this is only happening on pc's with IE8 on them... still no idea why, or how to solve it
Thank you, Ron
This issue may occur because IE8:
InternetSetOption fills in the same information included in the Proxy Server => Advanced section of the Internet Explorer Options interface.
The AutoConfigURL fills in the same information included in the Automatic Configuration section of the Internet Explorer Options interface.
These settings are mutually exclusive in the UI, so they are mutually exclusive in the registry. Setting one automatically clears the other. Set the proxy declaratively or imperatively, not both.
References
How to programmatically query and set proxy settings under Internet Explorer
WinInet Option Flags
Understanding Web Proxy Configuration