Windows 10 上 .NET Framework 4.0 安装损坏

Windows 10 上 .NET Framework 4.0 安装损坏

在一次糟糕的 Windows 更新后,sfc /scannow已确认一堆 .NET Framework 4.0 文件已“损坏”。以下是从日志中摘录的,列出了所有损坏的文件:

C:\WINDOWS\Microsoft.NET\Assembly\GAC_MSIL\PresentationFramework\v4.0_4.0.0.0__31bf3856ad364e35\\PresentationFramework.dll; source file in store is also corrupted
C:\WINDOWS\Microsoft.NET\Assembly\GAC_MSIL\PresentationFramework-SystemData\v4.0_4.0.0.0__b77a5c561934e089\\PresentationFramework-SystemData.dll; source file in store is also corrupted
C:\WINDOWS\Microsoft.NET\Assembly\GAC_MSIL\System.Windows.Controls.Ribbon\v4.0_4.0.0.0__b77a5c561934e089\\System.Windows.Controls.Ribbon.dll; source file in store is also corrupted
C:\WINDOWS\Microsoft.NET\Assembly\GAC_MSIL\UIAutomationClient\v4.0_4.0.0.0__31bf3856ad364e35\\UIAutomationClient.dll; source file in store is also corrupted
C:\WINDOWS\Microsoft.NET\Assembly\GAC_MSIL\UIAutomationClientsideProviders\v4.0_4.0.0.0__31bf3856ad364e35\\UIAutomationClientsideProviders.dll; source file in store is also corrupted
C:\WINDOWS\Microsoft.NET\Assembly\GAC_MSIL\UIAutomationProvider\v4.0_4.0.0.0__31bf3856ad364e35\\UIAutomationProvider.dll; source file in store is also corrupted
C:\WINDOWS\Microsoft.NET\Assembly\GAC_MSIL\UIAutomationTypes\v4.0_4.0.0.0__31bf3856ad364e35\\UIAutomationTypes.dll; source file in store is also corrupted
C:\WINDOWS\Microsoft.NET\Assembly\GAC_MSIL\WindowsBase\v4.0_4.0.0.0__31bf3856ad364e35\\WindowsBase.dll; source file in store is also corrupted
C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\\clr.dll; source file in store is also corrupted
C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\\mscordacwks.dll; source file in store is also corrupted
C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\\mscordbi.dll; source file in store is also corrupted
C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\\peverify.dll; source file in store is also corrupted
C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\\SOS.dll; source file in store is also corrupted
C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\NativeImages\\mscorlib.ni.dll; source file in store is also corrupted
C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\WPF\\PenIMC.dll; source file in store is also corrupted
C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\WPF\\PenIMC_v0400.dll; source file in store is also corrupted
C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\WPF\\PenIMC2_v0400.dll; source file in store is also corrupted
C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\WPF\\PresentationCore.dll; source file in store is also corrupted
C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\WPF\\PresentationFramework.dll; source file in store is also corrupted
C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\WPF\\PresentationFramework-SystemData.dll; source file in store is also corrupted
C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\WPF\\PresentationHost_v0400.dll; source file in store is also corrupted
C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\WPF\\PresentationNative_v0400.dll; source file in store is also corrupted
C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\WPF\\System.Windows.Controls.Ribbon.dll; source file in store is also corrupted
C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\WPF\\UIAutomationClient.dll; source file in store is also corrupted
C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\WPF\\UIAutomationClientsideProviders.dll; source file in store is also corrupted
C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\WPF\\UIAutomationProvider.dll; source file in store is also corrupted
C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\WPF\\UIAutomationTypes.dll; source file in store is also corrupted
C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\WPF\\WindowsBase.dll; source file in store is also corrupted
C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\WPF\\wpfgfx_v0400.dll; source file in store is also corrupted
C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\WPF\en-US\\PresentationHost_v0400.dll.mui; source file in store is also corrupted
C:\WINDOWS\Microsoft.NET\Framework64\v4.0.30319\\clr.dll; source file in store is also corrupted
C:\WINDOWS\Microsoft.NET\Framework64\v4.0.30319\\compatjit.dll; source file in store is also corrupted
C:\WINDOWS\Microsoft.NET\Framework64\v4.0.30319\\mscordacwks.dll; source file in store is also corrupted
C:\WINDOWS\Microsoft.NET\Framework64\v4.0.30319\\mscordbi.dll; source file in store is also corrupted
C:\WINDOWS\Microsoft.NET\Framework64\v4.0.30319\\peverify.dll; source file in store is also corrupted
C:\WINDOWS\Microsoft.NET\Framework64\v4.0.30319\\SOS.dll; source file in store is also corrupted
C:\WINDOWS\Microsoft.NET\Framework64\v4.0.30319\NativeImages\\mscorlib.ni.dll; source file in store is also corrupted
C:\WINDOWS\Microsoft.NET\Framework64\v4.0.30319\WPF\\PenIMC.dll; source file in store is also corrupted
C:\WINDOWS\Microsoft.NET\Framework64\v4.0.30319\WPF\\PenIMC_v0400.dll; source file in store is also corrupted
C:\WINDOWS\Microsoft.NET\Framework64\v4.0.30319\WPF\\PenIMC2_v0400.dll; source file in store is also corrupted
C:\WINDOWS\Microsoft.NET\Framework64\v4.0.30319\WPF\\PresentationCore.dll; source file in store is also corrupted
C:\WINDOWS\Microsoft.NET\Framework64\v4.0.30319\WPF\\PresentationFramework.dll; source file in store is also corrupted
C:\WINDOWS\Microsoft.NET\Framework64\v4.0.30319\WPF\\PresentationFramework-SystemData.dll; source file in store is also corrupted
C:\WINDOWS\Microsoft.NET\Framework64\v4.0.30319\WPF\\PresentationHost_v0400.dll; source file in store is also corrupted
C:\WINDOWS\Microsoft.NET\Framework64\v4.0.30319\WPF\\PresentationNative_v0400.dll; source file in store is also corrupted
C:\WINDOWS\Microsoft.NET\Framework64\v4.0.30319\WPF\\System.Windows.Controls.Ribbon.dll; source file in store is also corrupted
C:\WINDOWS\Microsoft.NET\Framework64\v4.0.30319\WPF\\UIAutomationClient.dll; source file in store is also corrupted
C:\WINDOWS\Microsoft.NET\Framework64\v4.0.30319\WPF\\UIAutomationClientsideProviders.dll; source file in store is also corrupted
C:\WINDOWS\Microsoft.NET\Framework64\v4.0.30319\WPF\\UIAutomationProvider.dll; source file in store is also corrupted
C:\WINDOWS\Microsoft.NET\Framework64\v4.0.30319\WPF\\UIAutomationTypes.dll; source file in store is also corrupted
C:\WINDOWS\Microsoft.NET\Framework64\v4.0.30319\WPF\\WindowsBase.dll; source file in store is also corrupted
C:\WINDOWS\Microsoft.NET\Framework64\v4.0.30319\WPF\\wpfgfx_v0400.dll; source file in store is also corrupted
C:\WINDOWS\Microsoft.NET\Framework64\v4.0.30319\WPF\en-US\\PresentationHost_v0400.dll.mui; source file in store is also corrupted

到目前为止我已经尝试过:

  1. Windows 更新(似乎是导致该问题的原因)

  2. Windows框架修复工具- 仅修复 Windows 10 上的 v4.7 或更高版本。毫无帮助地断言,所有较低版本都“包含在操作系统中”。

  3. 关闭与 .NET 相关的 Windows 功能,重新启动,然后重新打开。

    在此处输入图片描述

    我真的希望这会起作用,它声称是从 Windows 更新中重新下载,但最终结果似乎没有变化。

  4. DISM.exe /Online /Cleanup-image /Restorehealth(图片未找到)

  5. 按照以下方式下载源图像这个答案- 但根据 DISM,我的图像是10.0.19041.572

    PS C:\> dism
    Deployment Image Servicing and Management tool
    Version: 10.0.19041.572
    

    并且根据“关于”,我的图像是19042.630- 不知道为什么它们不一致:

    在此处输入图片描述

    并且唯一可用的图像不是上述任何一个。

    项目清单

    我尝试下载并提取,.631因为它看起来很接近,但使用它作为修复源仍然失败,并显示“未找到源”。(按照温蒂普斯

    突出的日志:

    Host machine information: OS Version=10.0.19042
    ...
    Executing command line: "C:\Windows\system32\Dism.exe" /Online /Cleanup-Image /RestoreHealth /Source:WIM:F:\sources\install.wim:6 /LimitAccess
    ...
    Target image information: OS Version=10.0.19042.630
    ...
    source for package or file not found, ResolveSource() unsuccessful. (CBS HRESULT=0x800f081f) - CCbsConUIHandler::Error
    The source files could not be found; their location must be specified using the /source option to restore the feature
    
  6. 到目前为止,我最成功的一次是将“Microsoft.NET”文件夹从家里另一台运行相同版本 Windows 的计算机上密封,取得所有权,覆盖文件,并将所有权交还给TrustedInstaller。它确实阻止了每个依赖于 Framework 4.0 的应用程序在启动时崩溃(我暗示损坏确实发生了),但sfc仍然将它们视为损坏。

任何不涉及重新安装的建议都会受到赞赏。

答案1

对您的 CBS 日志的分析表明,损坏的文件不包含在下载的 ISO 文件中,因此修复必须以错误代码 0x800f081f CBS_E_SOURCE_MISSING 结束。

我下载了最新发布的 Net-Framework 更新包 KB4586876,用 7zip 解压,然后再次用命令解压 Windows10.0-KB4586876-x64-NDP48.cab 文件expand "Windows10.0-KB4586876-x64-NDP48.cab" -f: *. * Target path

之后,我将版本号与日志中的错误文件进行了比较。比较结果显示它们匹配。

必须在 ISO 中实施更新包,然后以 ISO 作为源再次进行修复。

https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/servicing-the-image-with-windows-updates-sxs

然后文件就会被导入并且修复就会成功完成。

但是我选择了一个缩写并按照注释创建了修复包,SFCFix 程序将包中的文件直接复制到 WinSxs 文件夹中,然后 sfc 使用正确的文件进行修复。

相关内容