我正在尝试在本地运行/调试我的云项目,但服务总线连接因错误而崩溃:
<15:46:59> MessagingFactory successfully created
<15:47:39> Exception: The underlying connection was closed: An unexpected error occurred on a send..
....
System.IO.IOException: Unable to read data from the transport connection:
An existing connection was forcibly closed by the remote host. ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host
at System.Net.Sockets.Socket.EndReceive(IAsyncResult asyncResult)
at System.Net.Sockets.NetworkStream.EndRead(IAsyncResult asyncResult)
--- End of inner exception stack trace ---
at System.Net.TlsStream.EndWrite(IAsyncResult asyncResult)
at System.Net.PooledStream.EndWrite(IAsyncResult asyncResult)
at System.Net.ConnectStream.WriteHeadersCallback(IAsyncResult ar)}
使用Service Bus Explorer工具时也会收到此错误。
部署到云时一切正常,服务总线连接正常。
任何人都可以帮我吗?可能是什么原因? 提前谢谢!
答案 0 :(得分:3)
也许问题出在SSL证书验证协议。尝试执行此操作以强制使用最新的协议类型。
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
答案 1 :(得分:0)
导致此类错误的原因有多种,因此您可以查看以下内容
由于您的错误没有固定的解决方案,您可能需要努力工作以找出实际问题。如果启用,您还可以从日志文件中找到一些有用的信息。