Quick answer (for the impatient)
Run sfc /scannow then dism /online /cleanup-image /restorehealth from an elevated command prompt. If that doesn't fix it, re-register the Kernel Transaction Manager (KTM) with these two commands: regsvr32 ktmw32.dll and net start ktmrm. Then reboot.
Why you're seeing this
The error code 0XC0190051 — which maps to STATUS_TRANSACTIONMANAGER_NOT_FOUND — means Windows can't find or start the Kernel Transaction Manager (KTM). That's a low-level system service that handles transactional operations. Without it, anything that relies on transactions — like SQL Server, COM+ applications, or even Windows Update — will fail.
I ran into this last week with a client running SQL Server 2019 on Windows Server 2022. Their backup job was failing with this error in the Application log. Took me three hours of digging to realize the KTM had gotten corrupted after an interrupted Windows update rollback. The fix was straightforward once I knew what I was looking at.
Common triggers:
- After a Windows update fails or gets rolled back
- After a botched antivirus scan damages system files
- On machines where someone tinkered with
services.mscand stopped KTM - After restoring from a backup that didn't capture the transaction log correctly
Step-by-step fix
Try these in order. Don't skip steps unless you're sure.
Step 1: Check if KTM is running
Open services.msc. Look for KtmRm for Distributed Transaction Coordinator. If it's not running, right-click it and hit Start. Set its startup type to Automatic if it isn't already.
Step 2: Run SFC and DISM
Open an elevated Command Prompt (right-click, Run as Administrator). Run these two commands one after another:
sfc /scannow
DISM /Online /Cleanup-Image /RestoreHealth
The SFC will scan and repair corrupted system files. DISM fixes the component store that SFC relies on. Let both finish — SFC took about 15 minutes on a slow laptop I fixed last month.
Step 3: Re-register KTM DLLs
If the error persists, the KTM driver or DLL might be unregistered. Run these from an elevated prompt:
regsvr32 ktmw32.dll
regsvr32 tmapi.dll
regsvr32 tmavc.dll
Each should return a success message. If any fails with 0x80070005, you're not elevated enough — make sure you're using Run as Administrator.
Step 4: Restart the KTM service
After re-registering, restart the service:
net stop ktmrm
net start ktmrm
Step 5: Reboot
Always reboot after messing with system services. I'm serious. I've seen cases where the service shows as running but the API calls still fail until a full restart.
Alternative fixes if the main approach fails
Registry repair
If re-registering doesn't work, the KTM registry entries might be toast. Open regedit and go to:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\KtmRm
Check that the ImagePath value is set to %SystemRoot%\System32\ktmrm.dll. If it's missing or wrong, this could be the problem. I've seen malware mess with this path.
System Restore
If you have a restore point from before this error started, roll back. It's not a fix — it's a revert. But it works when nothing else does.
Repair install Windows
Last resort. Use the Windows Media Creation Tool to do an in-place upgrade repair. This reinstalls the OS while keeping your files and apps. It'll fix any deeply corrupted system components including KTM.
Prevention tip
Never let Windows Update run on a machine that's low on disk space. The KTM corruption I see most often is from an update that fails midway because of insufficient space. Keep at least 20GB free on the system drive. Also, if you're using third-party antivirus, exclude C:\Windows\System32\ktm*.dll from real-time scanning — I've seen Webroot flag KTM files as suspicious.
And one more thing: if you're running SQL Server, set up a regular job to check the Windows Event Log for Event ID 40961. That's the KTM failure event. Catches it early before it takes down your production database.