Windows Server 2019 .NET 累积更新安装失败:绕过 WUA 使用 DISM
2026年6月3日大约 2 分钟
Windows Server 2019 .NET 累积更新安装失败:绕过 WUA 使用 DISM
在 Windows Server 2019 上安装 .NET Framework 累积更新时,如果双击 .msu 或 wusa.exe 路径一直失败,并且 WindowsUpdate.log 出现 0xC8000402 PopulateDataStore failed,问题可能不是 CBS 安装失败,而是 WUA 扫描层已经坏了。
背景
某些 .NET 累积更新是容器包,里面包含多个真正适用的 .msu。例如一个总 KB 可能内嵌:
- .NET 3.5 + 4.7.2 的 MSU。
- .NET 3.5 + 4.8 的 MSU。
如果系统已经是 .NET 4.8,只需要安装对应 4.8 的那份。
关键日志
WindowsUpdate.log 反复出现:
ProtocolTalker *FAILED* [C8000402] PopulateDataStore failed
ProtocolTalker *FAILED* [C8000402] Sync of Updates
Agent * END * Finding updates ... Exit code = 0xC8000402CBS.log 中却搜不到目标 KB 的痕迹。
这说明补丁还没有进入 CBS 安装引擎,失败发生在更早的 WUA 扫描阶段。
根因判断
wusa.exe 安装 .msu 的流程大致是:
双击 .msu -> wusa.exe -> WUA 适用性扫描 -> CBS 安装如果 WUA 的 DataStore 损坏,或者离线扫描源反复注册导致元数据污染,WUA 可能在 PopulateDataStore 阶段失败,最终返回 “0 updates found” 或安装失败。
此时继续双击 .msu 没意义,因为永远到不了 CBS。
解决方案:解包后用 DISM 注入 cab
核心思路是绕过 WUA,直接让 CBS 处理 CAB 包。
1. 解压 MSU
$msu = "C:\Patches\windows10.0-kbxxxxx-x64-ndp48.msu"
$dst = "C:\Patches\Extract"
New-Item -ItemType Directory -Force -Path $dst | Out-Null
expand.exe -F:* $msu $dst2. 用 DISM 安装 CAB
$cab = Get-ChildItem $dst -Filter "Windows10.0-KB*.cab" | Select-Object -First 1
DISM.exe /Online /Add-Package /PackagePath:"$($cab.FullName)" /NoRestart /LogPath:C:\Patches\dism.log3. 重启
shutdown /r /t 304. 验证
Get-HotFix -Id KBxxxxx
DISM.exe /Online /Get-Packages | findstr /I "DotNetRollup"如果是 .NET 更新,还可以检查关键 .NET 文件版本是否更新。
可选:修复 WUA 扫描通道
如果后续还需要 Windows Update 正常扫描,可以重置 WUA 数据库:
Stop-Service -Name wuauserv, BITS, cryptSvc -Force
Rename-Item C:\Windows\SoftwareDistribution C:\Windows\SoftwareDistribution.old
Rename-Item C:\Windows\System32\catroot2 C:\Windows\System32\catroot2.old
$svc = New-Object -ComObject Microsoft.Update.ServiceManager
$svc.Services | Where-Object { $_.IsScanPackageService } |
ForEach-Object { $svc.RemoveService($_.ServiceID) }
Start-Service -Name wuauserv, BITS, cryptSvc这不是安装补丁的必要步骤,只是恢复 WUA 扫描能力。
总结
如果目标 KB 在 CBS.log 中完全没有痕迹,而 WindowsUpdate.log 指向 0xC8000402 PopulateDataStore failed,就要把问题定位在 WUA 扫描层。
处理方式是:
- 确认实际适用的内嵌 MSU。
- 解压 MSU 得到 CAB。
- 用
DISM /Add-Package直接注入。 - 重启并验证。
这个方法适合 WUA 损坏但 CBS 仍正常的场景。
