现象
Visual Studio Installer 卡住,无法下载
笔记本电脑就是这样,明明很好的网络,却一直显示下载0B和0B/秒,进度条没有动,并且过一会显示网络有问题,重新下载下载器也是这样:
原因
试了网上说的各种办法,比如修改DNS,换用手机热点,都不行。然后看网上说去查看日志C:\Users\xxx\AppData\Local\Temp
打开dd_bootstrapper_xxx(时间戳).log发现:
VisualStudio Bootstrapper:2021/1/18 14:22:53: WebClient error 'TrustFailure' - proxy setting 'Default' - 'https://aka.ms/vs/16/release/installer'.
VisualStudio Bootstrapper:2021/1/18 14:22:53: WebClient failed in 'https://aka.ms/vs/16/release/installer' with '基础连接已经关闭: 未能为 SSL/TLS 安全通道建立信任关系。' - 'https://aka.ms/vs/16/release/installer'.
VisualStudio Bootstrapper:2021/1/18 14:22:53: WebClient failed attempting to access https://aka.ms/vs/16/release/installer via 127.0.0.1
VisualStudio Bootstrapper:2021/1/18 14:22:53: Download failed using WebClient engine. System.Net.WebException: 基础连接已经关闭: 未能为 SSL/TLS 安全通道建立信任关系。 ---> System.Security.Authentication.AuthenticationException: 根据验证过程,远程证书无效。
我用浏览器直接访问aka.ms会报隐私错误,所以这就是问题所在!
尝试用命令行ping aka.ms,结果显示ip地址是本机(127.0.0.1),简直离谱。
解决办法
在C:\Windows\System32\drivers\etc\hosts文件里添加aka.ms的映射.
查询ip域名
我用的是 104.79.121.189
在hosts文件添加
#aka.ms
104.79.121.189 aka.ms
然后就OK了。