Hi, In order for my application (.Net 1.1) to use the system configured proxy server (trough a proxy.pac script) I was using an interop calls to WinHTTP function WinHttpGetProxyForUrl, passing the proxy.pac url I got from the registry.
Unfortunately, I hit a deployment scenario, where this does not work, as the proxy.pac file is deployed locally on the user's hard drive, and the url is "file://C://xxxx"
As clearly stated in the WinHttpGetProxyForUrl docs, it works only with http and https schemes, so it fails with file://
I'm considering 2 "ugly" solutions to the problem (the pac file is javascript):
Creating a separate JScript.NET project, with a single class with single static method Eval(string), and use it to eval in runtime the function read from the pac file
Building at runtime a JScript.NET assembly and load it.
As these solutions are really ugly :), does anybody know a better approach? Is there a Windows function which I can use trough interop?
If not, what are you guys thinking about the above 2 solutions - which one would you prefer?