官方版

Problem

I get a System.NET.WebException “The underlying connection was closed” when calling into WebServices.

Solution

When debugging a .Net application through Fiddler, you may see a System.Net.WebException, with message “The underlying connection was closed: A connection that was expected to be kept alive was closed by the server.”
This is a bug in your application (it should handle this type of exception).
Note: This problem is very unlikely in Fiddler 2.2.8.5 and later, due to enhanced client connection reuse support.

谷歌翻译版

问题

我有一个System.NET。调用WebServices时,发现“底层连接已关闭”。

解决方案

通过Fiddler调试.Net应用程序时,您可能会看到System.Net.WebException,并显示消息“基础连接已关闭:服务器已关闭了预期保持活动的连接”。
这是您的应用程序中的错误(它应该处理这种类型的异常)。
注意:由于增强了客户端连接重用支持,因此在Fiddler 2.2.8.5和更高版本中此问题极少发生。