I am trying to run/debug locally my cloud project, but service bus connection keeps crashing with error:
<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)}
Also I receive this error when using Service Bus Explorer tool.
When deploy to cloud everything works ok, service bus connection is ok.
Can anyone help me with this? what could be the reason? Thank you in advance!
Maybe the problem is with the SSL certificate validation protocol. Try this to force the latest protocol type.
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
There are several reason leading to such error so you may check the following
Since there is no fixed solution for your error, you may have to work a little hard to figure out the actual issue. You may also find some useful information from the log files if enabled.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With