Windows Server 2012 R2 或 2016 无法安装 .Net 3.5.1

租用阿里云ECS服务器的用户使用 Windows Server 2012 R2 或 Windows Server 2016 64位系统,发现在安装 .net framework 3.5.1 时报错,报错内容如下:

1

原因分析

找不到安装源文件。

解决办法

可以通过如下 PowerShell 脚本进行安装:

  1. 从开始菜单中找到 PowerShell,右击选择 以管理员身份运行。

  2. 输入如下脚本后回车执行:

  3. 1
    2
    3
    4
    5
    Set-ItemProperty -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU' -Name UseWUServer -Value 0
     Restart-Service -Name wuauserv
     Install-WindowsFeature Net-Framework-Core
     Set-ItemProperty -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU' -Name UseWUServer -Value 1
     Restart-Service -Name wuauserv
posted @ 2017-07-26 10:44  飘逸的华仔  阅读(2682)  评论(1)    收藏  举报