When working with Windows Server or Windows 10/11, you may encounter the error:
The referenced assembly could not be found. Error: 0x80073701.
This issue typically arises when adding or removing features or roles. A similar error may also appear when trying to enable optional features via PowerShell, such as the Windows Subsystem for Linux (WSL):
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
This error indicates that the necessary source files for the specified component are either missing or corrupt in the Windows installation image.
To troubleshoot, first check for any updates that may require a reboot by running:
dism /online /get-packages /format:table | Select-String "Pending"
Reboot the system if updates are pending. If issues persist and certain packages remain in a Pending Reboot state after multiple reboots, you can rename the C:WindowsWinsxsPending.xml
file to Pending.xml.old
and restart the server.
Subsequently, use DISM to check the integrity of the Windows image:
DISM /Online /Cleanup-Image /CheckHealth
If it indicates that the component store is repairable, proceed with:
DISM /Online /Cleanup-Image /RestoreHealth
Next, verify the integrity of the system files by running:
sfc /scannow
If Windows features are still unserviceable post-repairing system files, consult the %windir%LogsCBSCBS.log
for errors.
The CBS log could reveal messages indicating missing files from a specific update, like KB5012170
. If this is the case, manually download and install the update from the Microsoft Update Catalog. If the update can’t be installed directly, you can extract the contents of the MSU file and manually add the CAB package to the Windows image:
expand -f:* windows10.0-kb5012170-x64 c:tempDISM.exe /Online /Add-Package /PackagePath:c:TempWindows10.0-KB5012170-x64.cab
If the update is not applicable to your Windows version, you might need to configure Windows to ignore the corrupted package. Note, these steps are risky and should be approached with caution:
- Navigate to
HKLMSOFTWAREMicrosoftWindowsCurrentVersionComponent Based Servicing
in the registry. - Change the ownership of this registry key to your account and grant full control.
- Find the listed update package and set the CurrentState value to 0, indicating it is not present.
- Restore original permissions for security and restart your computer.
Afterwards, check if you can install Windows features without issues. If multiple KB packages show ERROR_SXS_ASSEMBLY_MISSING
, repeat the process for each.
As a last resort, consider performing an in-place upgrade, using an installation ISO compatible with your current build. Execute setup.exe
from the ISO and choose the option to keep personal files and apps.
For further assistance, refer to the following links: