Fixing CO_E_CLRNOTAVAILABLE (0x80004028): CLR Not Available
The CLR (common language runtime) isn't loaded or registered. Usually happens after a .NET install or update. Here's the real fix.
You're staring at CO_E_CLRNOTAVAILABLE (0x80004028) and your app won't start. Yeah, that's frustrating. Let's cut to the chase.
The Quick Fix: Reset CLR Registration
Open an elevated Command Prompt (right-click, Run as administrator). Then run these two commands in order:
regsvr32 /u mscoree.dll
regsvr32 mscoree.dll
Restart your machine. That's it for most cases.
What's actually happening here is that the CLR (mscoree.dll) is either not registered correctly, or its registration got corrupted by a .NET framework update or a failed install. The /u flag unregisters the old entry, then the second command re-registers it fresh. The reboot ensures the service host picks up the new registration.
If that doesn't work, the next step is to re-register the .NET Framework itself. Still in the elevated prompt:
%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_regiis.exe -iru
%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe -iru
Run both—even if you're on a 64-bit system, some components need the 32-bit version. The -iru flag reinstalls and updates the CLR registration without touching your existing apps.
Why This Error Happens
The error code 0x80004028 is defined in the Windows SDK as CO_E_CLRNOTAVAILABLE. It means the COM runtime tried to start the CLR through CoInitializeEE or CoCreateInstance with a CLSID that requires the CLR, but the CLR wasn't loaded.
The root cause is usually one of three things:
- Corrupted .NET install — a recent Windows update or manual .NET removal left the registration in a bad state.
- Permission lock — antivirus or security software blocked the CLR from loading during a critical sequence.
- Missing runtime — specifically, the .NET Framework 2.0/3.5 or 4.x runtime isn't installed or is disabled in Windows Features.
I've seen this most often after a feature update to Windows 10 (version 22H2) or Windows 11 (22H2 and 23H2). The update migrates the .NET Framework but sometimes leaves the registration broken. You'll get the error in Visual Studio, SQL Server Management Studio, or even some old .NET WinForms apps.
Less Common Variations
If the above doesn't fix it, check these:
.NET Framework 3.5 Not Enabled
Some apps target .NET 3.5, which includes CLR 2.0. Go to Control Panel > Programs > Turn Windows features on or off and check .NET Framework 3.5 (includes .NET 2.0 and 3.0). Hit OK, let Windows install it, reboot.
Redirected .NET Framework
If you have multiple .NET versions, the application's config file might be pointing at a version that doesn't exist. Look in the app's .exe.config file for a <supportedRuntime> tag:
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" />
</startup>
If the version is wrong (e.g., it says v4.0 but you only have v4.7.2 installed), fix the version number or install the required runtime. You can find the exact version string in the registry under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full\Version.
Side-by-Side Assembly Corruption
This one's rare but real. The CLR's manifest file (in %windir%\WinSxS) may be corrupted. Run the System File Checker:
sfc /scannow
If it finds corruption, it'll fix it. Reboot after.
Prevention
The best way to avoid this error is to never let your .NET Framework install get mangled. That means:
- Don't manually unregister mscoree.dll unless you know exactly what you're doing. It's not a COM component you should touch.
- Always install .NET updates through Windows Update, not third-party tools.
- Keep Windows Features consistent — if you disable .NET 3.5, apps that depend on it will fail silently before you see this error.
- Run a repair after a failed .NET update:
dism /online /cleanup-image /restorehealthfollowed bysfc /scannow.
If you're a developer shipping an app that hits this error, wrap your entry point in a try-catch for COMException with HResult == 0x80004028 and display a message telling the user to run the regsvr32 fix above. It's a clean cop-out and saves your support team dozens of tickets.
Was this solution helpful?