If your Windows 11 computer suddenly slows to a crawl and Task Manager shows .NET Runtime Optimization Service or mscorsvw.exe eating 50-100% of your CPU, you are not alone. This is one of the most common performance complaints after Windows updates, and the fix is straightforward.
The short answer: this process is precompiling .NET code in the background. It is supposed to finish and stop on its own, but sometimes it gets stuck. You can force it to complete in about 15 minutes.
What Is .NET Runtime Optimization Service?
The .NET Runtime Optimization Service (mscorsvw.exe) is a built-in Windows process that converts .NET application code from intermediate language (IL) into native machine code. This is called “precompilation” or “native image generation.”
In plain English: it pre-processes code so that .NET applications (which includes a huge number of Windows programs) start faster and run more efficiently. The process is managed by the Native Image Generator (ngen.exe).
Why It Spikes Your CPU
The optimization service triggers after:
- Windows Update — New .NET framework components need recompilation
- .NET framework installation or repair — Any change to the framework triggers a full recompilation queue
- Application installations — Some apps that use .NET add items to the ngen queue
- Major Windows upgrades — Feature updates (like 23H2 to 24H2) requeue everything
Under normal circumstances, it runs in the background at low priority and finishes within 5-20 minutes. The CPU spike becomes a problem when:
- The queue is very large — After a major update, hundreds of assemblies may need processing
- The process gets stuck — A corrupted assembly can cause ngen to loop on the same item
- Multiple instances run simultaneously — Both 32-bit and 64-bit versions may compete for CPU
The Quick Fix: Force It to Finish
Instead of waiting (or killing the process, which just restarts it), you can force the optimization queue to process everything immediately.
Open Command Prompt as Administrator and run:
C:\Windows\Microsoft.NET\Framework\v4.0.30319\ngen.exe executeQueuedItems
Then run:
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\ngen.exe executeQueuedItems
These commands process the 32-bit and 64-bit queues respectively. You will see output showing each assembly being compiled. Wait for both to complete — typically 5-15 minutes — and your CPU usage will return to normal.
What If the Fix Does Not Work?
If forcing the queue does not resolve the issue, try these steps in order:
1. Restart the Service
Open Services (press Win+R, type services.msc), find .NET Runtime Optimization Service, right-click, and select Restart. Then run the ngen commands again.
2. Repair .NET Framework
Open Command Prompt as Administrator and run:
DISM /Online /Cleanup-Image /RestoreHealth
sfc /scannow
This repairs corrupted system files including .NET components. Restart your computer after both commands complete.
3. Check for Malware
While mscorsvw.exe is legitimate, some malware mimics it. Verify the process location in Task Manager — it should be in C:\Windows\Microsoft.NET\Framework\ or Framework64. If it is running from AppData, Temp, or any other folder, you have malware. Run a full malware scan immediately.
4. Reinstall .NET Framework
As a last resort, download the latest .NET Framework from Microsoft and run a repair installation. This rebuilds the framework from scratch and resets the optimization queue.
Should You Disable It Permanently?
No. Disabling the .NET Runtime Optimization Service means every .NET application on your system will run slower because it has to compile code on-the-fly instead of using precompiled native images. Programs like Visual Studio, PowerShell, Windows Defender, and many business applications all depend on .NET.
The service is designed to run once after updates and stop. If it keeps coming back, the root cause is usually a corrupted framework installation — fix that instead of disabling the service.
Related Guides
- Computer Optimization & Speed — our full service page
- How to Fix a Slow Computer
- Signs Your Computer Needs Optimization
- Fix 100% Disk Usage Windows 11
When to Call a Professional
If you have tried the steps above and mscorsvw.exe is still consuming high CPU for days, or if you suspect malware, it may be time for professional help. Persistent .NET issues can indicate deeper system corruption that requires hands-on diagnosis.
Techrepair DFW handles high CPU usage problems across the Dallas-Fort Worth area. We diagnose the root cause and fix it — whether it is a stuck .NET service, malware, or failing hardware.
Call (469) 523-1506 or contact us online to schedule a repair.