Disable proxy for entire application?

后端 未结 2 1098
梦如初夏
梦如初夏 2021-01-07 09:41

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 befor

相关标签:
2条回答
  • 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.

    0 讨论(0)
  • 2021-01-07 10:23

    Brent - that's the correct solution : adding a defaultProxy element to your application's configuration file.

    So for a website, it's the web.config. For an .exe application, it's .config.

    And those settings are also correct :-

    <?xml version="1.0" encoding="utf-8" ?>
    <configuration>
        <system.net>
            <defaultProxy enabled="false" useDefaultCredentials="false">
                <proxy/>
                <bypasslist/>
                <module/>
            </defaultProxy>
        </system.net>
    </configuration>
    
    0 讨论(0)
提交回复
热议问题