Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>There are two possible scenarios here:</p> <p>1: If you are building a client app (e.g. Console or WinForms) and want to access <a href="http://localhost" rel="nofollow noreferrer">http://localhost</a> using WebClient or HttpWebRequest without any intervening proxies, then <code>bypassonlocal="True"</code> should accomplish this. In other words, your app.config should look like this:</p> <pre><code>&lt;defaultProxy&gt; &lt;proxy usesystemdefault="False" bypassonlocal="True" /&gt; &lt;/defaultProxy&gt; &lt;/system.net&gt; </code></pre> <p>2: if, however, you're trying to get your ASP.NET app (running on <a href="http://localhost" rel="nofollow noreferrer">http://localhost</a>) to be able to correctly resolve URIs either with a proxy or without one, then you'll need to set up proxy info correctly in your web.config (or in machine.config so you won't have to change your app's web.config), so ASP.NET will know that you are running a proxy or not running one. Like this:</p> <p>Home:</p> <pre><code>&lt;defaultProxy&gt; &lt;proxy usesystemdefault="False" bypassonlocal="True" /&gt; &lt;/defaultProxy&gt; &lt;/system.net&gt; </code></pre> <p>Work:</p> <pre><code>&lt;defaultProxy&gt; &lt;proxy usesystemdefault="False" proxyaddress="http://yourproxyserver:8080" bypassonlocal="True" /&gt; &lt;/defaultProxy&gt; &lt;/system.net&gt; </code></pre> <p>It's also possible to use proxy auto-detection, to pick up settings from the registry, etc. but I've always shied away from those approaches for servers apps... too fragile. </p> <p>BTW, if you find that things are configured correctly, and you still get the error, the first thing I'd recommend is to code up a quick test which manually sets the proxy before your WebClient/HttpWebRequest call, instead of relying on configuration to do it. Like this: </p> <pre><code>WebProxy proxyObject = new WebProxy("http://proxyserver:80/",true); WebClient wc = new WebClient(); wc.Proxy = proxyObject; string s = wc.DownloadString ("http://www.google.com"); </code></pre> <p>If the requests don't go through your work proxy correctly even when you're using code, even if the proxy is correctly configured in your code, then the proxy itself may be the problem. </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload