There are two possible scenarios here:
1: If you are building a client app (e.g. Console or WinForms) and want to access http://localhost using WebClient or HttpWebRequest without any intervening proxies, then bypassonlocal="True"
should accomplish this. In other words, your app.config should look like this:
<defaultProxy>
<proxy
usesystemdefault="False"
bypassonlocal="True"
/>
</defaultProxy>
</system.net>
2: if, however, you're trying to get your ASP.NET app (running on http://localhost) 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:
Home:
<defaultProxy>
<proxy
usesystemdefault="False"
bypassonlocal="True"
/>
</defaultProxy>
</system.net>
Work:
<defaultProxy>
<proxy
usesystemdefault="False"
proxyaddress="http://yourproxyserver:8080"
bypassonlocal="True"
/>
</defaultProxy>
</system.net>
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.
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:
WebProxy proxyObject = new WebProxy("http://proxyserver:80/",true);
WebClient wc = new WebClient();
wc.Proxy = proxyObject;
string s = wc.DownloadString ("http://www.google.com");
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.