第一步:修改dns
第二步:如果还没解决,打开cmd输入
ipconfig/flushdns
更新一下dns缓存
第三步:如果还没解决,修改hosts文件(位于C:\Windows\System32\drivers\etc)
在文件末尾追加一行
104.102.40.139 aka.ms
需要先把hosts从C盘复制出来,修改后再复制回去
第四步:如果还没解决,删除visual studio installer
按照官网的解决方案https://learn.microsoft.com/zh-cn/troubleshoot/developer/visualstudio/installation/troubleshoot-installation-issues中的第四条的方法删除对应文件夹,然后在https://visualstudio.microsoft.com/downloads/中重新下载对应版本的visual studio installer
第四步:重新启动visual studio installer,或者在你的版本的visual studio里面选择“工具”-“获取工具和功能”里面再执行需要的操作。我在执行完这一步操作以后问题才得到解决