1

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

Ron Gross
  • 1,474
  • 5
  • 19
  • 34

1 Answers1

0

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

Paul Sweatte
  • 24,148
  • 7
  • 127
  • 265
  • It's strange. I get this behavior only if I call it from SYSTEM account. If those settings are mutually exclusive, how come it works as expected if you run it as regular user? It "activates" the proxy settings and doesn't delete AutoConfigUrl. – Eugene Jan 12 '18 at 23:06