c# – 找不到System.Net.SecurityProtocolType.Tls12定义
发布时间:2020-12-15 19:47:44 所属栏目:百科 来源:网络整理
导读:我正在尝试将以下代码行添加到网站项目中的Global.asax文件中. System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls12; vs2012 IntelliSense显示存在Tls12定义.但构建是说定义不存在(参见屏幕截图). 我已经尝试将System
我正在尝试将以下代码行添加到网站项目中的Global.asax文件中.
System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls12; vs2012 IntelliSense显示存在Tls12定义.但构建是说定义不存在(参见屏幕截图). 我已经尝试将System.Net.dll添加到项目的bin文件夹中,但构建仍然失败.知道我怎么能解决这个问题? 解决方法
仅在Framework 4.0上缺少SecurityProtocolType.Tls11和SecurityProtocolType.Tls12枚举值.
SecurityProtocolType数值: 在Framework 4.0上,如果要允许TLS 1.0,1.1和1.2,只需替换: SecurityProtocolType.Tls | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12 通过: (SecurityProtocolType)(0xc0 | 0x300 | 0xc00) (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |