VS2013无法正常使用Nuget的解决方案

一、根本原因

1、Nuget官方网站已经不支持http访问,只支持https。

2、VS2013访问https默认使用的协议为Tls1.1,但是Nuget官方网站只支持Tls1.2

 

二、解决方案(要让vs2013以Tls1.3访问Nuget的官网)

1、找到设置:VS > 工具 > NuGet包管理器 > 程序包管理器设置 > 程序包源

2、将 https://www.nuget.org 和 https://www.nuget.org/api/v2/ 作为可用程序包源

3、在 VS > 工具 > NuGet包管理器 > 程序包管理器控制台 输入以下命令

     [Net.ServicePointManager]::SecurityProtocol=[Net.ServicePointManager]::SecurityProtocol-bOR [Net.SecurityProtocolType]::Tls12

 

 

至此,问题得到解决

 

posted @ 2022-04-21 09:51  kylinll  阅读(4365)  评论(1)    收藏  举报