问题描述

使用 Windows Server 2012 R2 或 Windows Server 2016系统,发现在安装 .net 3.5.1 时报错,报错内容如下:

原因分析

找不到安装源文件。

解决办法

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

  1. 从开始菜单中找到 PowerShell,右击选择 以管理员身份运行。
  2. 输入如下脚本后回车执行:

    1. Set-ItemProperty -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU' -NameUseWUServer -Value 0
    2. Restart-Service -Name wuauserv
    3. Install-WindowsFeature Net-Framework-Core
    4. Set-ItemProperty -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU' -NameUseWUServer -Value 1
    5. Restart-Service -Name wuauserv

 

 

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

  

相关文章:

  • 2021-12-16
  • 2021-12-28
  • 2021-12-02
  • 2021-07-13
  • 2021-12-02
  • 2021-06-27
  • 2021-04-17
  • 2021-11-17
猜你喜欢
  • 2021-07-13
  • 2021-08-11
  • 2021-08-19
相关资源
相似解决方案