When adding or removing features/roles on Windows Server or desktop computers running Windows 10/11, you may encounter an error:
The referenced assembly could not be found. Error: 0x80073701.
There is a similar error when trying to add an optional Windows feature by using PowerShell (in this case, WSL):
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
Enable-WindowsOptionalFeature : The referenced assembly could not be found.
This error means that the source files for the specified component are missing or corrupted in the Windows image.
Before troubleshooting, check for updates that require a host reboot (with Pending Reboot status).
dism /online /get-packages /format:table | Select-String "Pending"
If a reboot is required after installing any components or packages, do so.
Then, use the DISM to verify the integrity of the Windows image:
DISM /Online /Cleanup-Image /CheckHealth
If this command returns ‘The component store is repairable’, repair it:
DISM /Online /Cleanup-Image /RestoreHealth
Then, check the integrity of Windows system files and repair them if required (the repaired component sores will be used as the source of the original files):
sfc /scannow
If Windows features are still not installed after restoring system files, check the %windir%\Logs\CBS\CBS.log
for errors.
The CBS log on my Windows Server 2022 host showed an error indicating missing system files from the previously installed KB5012170 update.
CBS Failed to pin deployment while resolving Update: Package_for_KB5012170~31bf3856ad364e35~amd64~~20348.880.1.1from file: (null) [HRESULT = 0x80073701 – ERROR_SXS_ASSEMBLY_MISSING]
In this case, manually download and install the specified Windows update from the Microsoft Update Catalog.
If you cannot install the update from the MSU file, extract the MSU file and manually add a CAB update package to the Windows image:
Extract the MSU package:
expand -f:* windows10.0-kb5012170-x64 c:\temp
Add a package to an online Windows image:
DISM.exe /Online /Add-Package /PackagePath:c:\Temp\Windows10.0-KB5012170-x64.cab
If the package is not available for download or if the update is not applicable to your Windows version, you can configure Windows to ignore the corrupted package
- Go to the registry key
HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing
- Make your account the owner of this reg key (the default owner is
TrustedInstaller
) and give yourself full control permissions. - Locate the registry key that contains the update package you want to ignore.
- Change the value of the CurrentState parameter to 0. This informs the Windows Servicing process that the component is neither installed nor enabled.In my example, the previous value of the package state was
112
(Installed), so I changed it to0
(Not present). - Restore the original permissions to the registry key, leaving only ReadOnly access for the administrator.
- Restart your computer and confirm that Windows features (roles) can now be added successfully
ERROR_SXS_ASSEMBLY_MISSING
for multiple KB packages, follow the steps above for each of them. All packages with ASSEMBLY MISSING errors from CBS.LOG can be listed by searching the file with Select-String cmdlet:Select-String -Path "c:\windows\logs\cbs\cbs.log" -Pattern "Failed to pin"
If this doesn’t resolve the issue, try performing an in-place upgrade of your current Windows build using the latest version of the installation ISO image for your operating system edition. Run setup.exe from the Windows installation image and select Keep personal files and apps when choosing the update mode.