我正在将安全协议更新到现有的3.5.net框架应用程序以使我的支付网关顺利工作。我在Global.asax
添加以下代码SecurityProtocolTypeExtensions.Tls12;在当前上下文中不存在
System.Net.ServicePointManager.SecurityProtocol = SecurityProtocolTypeExtensions.Tls12;
在Application_Start
,但它给我编译时错误
名称“SecurityProtocolTypeExtensions”不在 当前上下文存在
我正在关注微软提供的此链接S upport for TLS System Default Versions included in the .NET Framework 3.5.1 on Windows 7 SP1 and Server 2008 R2 SP1。
更新1:
也试过如告诉记者,在上面的链接,添加项目这两个文件,现在我得到一个异常“System.NotSupportedException
:请求的安全协议不支持”
更新2:
按照Jon Davies的建议试用,但仍然没有运气。同样异常System.NotSupportedException
从我应该在哪里弄这些源文件, – user6594294
复制文章的** Developer Guidance **部分中的定义。 –
和我应该在哪里保存该代码,因为它看起来是内部System.Net命名空间,它是.net核心类 – user6594294