来自asp.net mvc网站的天蓝色认知搜索的连接问题 [英] connection issue to azure cognitive search from asp.net mvc website

查看:66
本文介绍了来自asp.net mvc网站的天蓝色认知搜索的连接问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个在.NET Framework 4.7中开发的asp.net mvc网站.从托管网站获取连接问题.你能帮忙吗

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

推荐答案

在调试时,我通常会遇到此错误,但是如果部署此错误,它将消失.
为了进行调试,请在调用外部服务之前添加以下行.
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;

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;

这篇关于来自asp.net mvc网站的天蓝色认知搜索的连接问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆