Visual Studio 2015-调试HTTP连接问题 [英] Visual Studio 2015 - Debug with HTTP connection problems

查看:204
本文介绍了Visual Studio 2015-调试HTTP连接问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个程序(控制台应用程序),该程序利用LinqToTwitter阅读一些推文.当我调试程序时,出现错误底层连接已关闭:提交中发生意外错误".

I have a program (console application) that makes use of LinqToTwitter to read some tweets. When I debug the program I get an error "The underlying connection was closed: An unexpected error occurred in a submission".

消息=发送请求时发生错误. 消息=基础连接已关闭:发生意外的发送错误.

Message = An error occurred while sending the request. Message = The underlying connection was closed: An unexpected send error occurred.

如果我构建程序,则可以毫无问题地运行该程序.我已经研究过,找不到问题.它与TLS 1.2有关吗?如何在Visual Studio中设置?我使用VS 2015.

If I build the program, I can run the program without any problems. I already researched and can't find the problem. Does it have to do with TLS 1.2? How do I set up in Visual Studio? I use VS 2015.

推荐答案

现在您提到TLS 1.2,并且您使用的是Visual Studio的旧版本,这很有意义.将此添加到您的Main过程:

Now that you mention TLS 1.2 and you're using an older version of Visual Studio, it makes sense. Add this to your Main procedure:

ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12

Twitter不久前已切换到TLS 1.2.

Twitter switched to TLS 1.2 a while ago.

这篇关于Visual Studio 2015-调试HTTP连接问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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