使用 Windows Server 2012 R2 或 Windows Server 2016系统,发如今安装 .NET Framework 3.5.1 时报错,报错内容以下图所示。html
找不到安装源文件。服务器
您能够使用以下 PowerShell 脚本进行安装。网络
从 开始 菜单中找到 PowerShell,右键单击选择 以管理员身份运行。优化
输入以下脚本后,按回车键执行。spa
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
注意:code
1. Windows Server 2012 与 Windows Server 2016 内存占用较高,安装其余应用程序使内存消耗更高,可能会致使内存不足引发安装失败,所以建议增长物理内存,若是是 IO 优化实例,能够酌情 开启系统虚拟内存。htm
2. 若是安装报错:0x800f081f,那么请检查公网网络是否正常,若是正常,多是链接微软 update 服务器链路不稳定致使更新失败,建议更换时间段重试。blog