connection issue to azure cognitive search from asp.net mvc website

萝らか妹 提交于 2020-05-24 05:32:11

问题


I have a asp.net mvc website developed in .NET framework 4.7. getting connection issue from hosted website. can you please help

An error occurred while sending the request. ---> System.Net.WebException: 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


回答1:


I usually face this error while debugging, but if you deploy this it will disappear.
For debugging purpose, add following lines before calling external services.
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;



来源:https://stackoverflow.com/questions/61202514/connection-issue-to-azure-cognitive-search-from-asp-net-mvc-website

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!