使用 Windows Server 2012 R2 或 Windows Server 2016系统,发现在安装 .NET Framework 3.5 时报错的解决方法:
从 开始 菜单中找到 PowerShell,右键单击选择 以管理员身份运行。
按以下顺序依次输入如下脚本后,按回车键执行。
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