The underlying connection was closed错误

来源:互联网 发布:mac的应用程序 编辑:程序博客网 时间:2024/05/21 10:11
今天理IIS上Asp.net程序的所有报错日志,发现好报The underlying connection was closed: Unable to connect to the remote server. 于是搜了下,发现很多人遇到这个异常,可是却没有标准的解决方案,一般有一下几种。
 
1.如果用了代理,设置正确。
2.如果用了firewall,将firewall禁掉试试。
3.将Lan设置中的Automatically Detect Settings禁掉。
4.重装.Net Framework。
5.如果用了抓取,可以将HttpWebRequest的KeepAlive属性设置为false,HttpWebRequest的KeepAlive属性默认是true

对应我线上的程序,1、2、3、4都可以排除,我的就是抓取时报这个错,采用了第5种方法后,异常消失了。


come from http://www.2cto.com/kf/201301/182249.html

0 0