经过搜索,终于发现了问题,原来.NET4.0中的默认代理是开启的。
"It's not set at all in app.cong or machine.config. Hmm. If I'm reading the
MSDN docs right, the default for defaultProxy.enabled is TRUE if the element
isn't specified at all. That would be consistent with my observations.
"
解决方法:
.config文件中添加配置节
<system.net>
<defaultProxy enabled="false" useDefaultCredentials="false" >
<proxy usesystemdefaults="true" proxyaddress="http://192.168.1.10:3128/" bypassonlocal="true" />
<bypasslist>
<add address="[a-z]+\.contoso\.com" />
</bypasslist>
<module/>
</defaultProxy>
</system.net>
<defaultProxy enabled="false" useDefaultCredentials="false" >
<proxy usesystemdefaults="true" proxyaddress="http://192.168.1.10:3128/" bypassonlocal="true" />
<bypasslist>
<add address="[a-z]+\.contoso\.com" />
</bypasslist>
<module/>
</defaultProxy>
</system.net>
参考资料:
http://msdn2.microsoft.com/en-us/library/kd3cf2ex(VS.80).aspx