views:

203

answers:

1

Ever since upgrading to Visual Studio 2010, I'm running into an issue where the first web request of any type (WebRequest, WebClient, etc.) hangs for about 20 seconds before completing. Subsequent calls work quickly. I've narrowed down the problem to a proxy issue.

If I manually disable proxy settings, I don't experience this delay:

Dim wrq As WebRequest = WebRequest.Create(Url)
wrq.Proxy = Nothing

What's strange is that there are no proxy settings enabled on this machine in Internet Options. What I'm wondering is if there is a way to disable proxy settings for my entire project in one shot without explicitly disabling as above for every web object.

The main reason I want to be able to do this is that I'm trying to use an API (http://code.google.com/p/google-api-for-dotnet/) which uses web requests, but does not provide any way to manually disable proxy settings.

I have found some information suggesting that I need to add some proxy information to the app.config file, but I get errors building my program if I make an edits to that file.

Can anyone point me in the right direction?

+1  A: 

Instead of turning off the proxy setting altogether you can try using the bypasslist to turn it off for the servers that you're having problems with.
See http://msdn.microsoft.com/en-us/library/kd3cf2ex.aspx for details and a sample.

If you're having problems changing the app.config I suggest posting the errors and possibly the app.config as well.

ho1
Well, I gave editing the app.config another try, and I'm not getting the error messages anymore. Here is the code I had to add to disable proxy settings for the application: <system.net> <defaultProxy enabled="false" useDefaultCredentials="false"> <proxy/> <bypasslist/> <module/> </defaultProxy> </system.net>Thanks!
Brent