Fix STATUS_TRANSACTED_MAPPING_UNSUPPORTED_REMOTE (0XC0190040)
This error pops up when a file on a network drive or remote share tries to use memory mapping inside a transaction. The fix is simple: stop using transactions on remote files.
You hit this error. Let's get it fixed.
I've seen STATUS_TRANSACTED_MAPPING_UNSUPPORTED_REMOTE (0XC0190040) pop up in production databases and file sync tools more times than I can count. Usually it shows as a crash in your application logs or a failed database operation. The short version: Windows doesn't let you create a memory-mapped section of a file on a remote drive when that file is part of a transaction. Here's exactly what to do.
The fix: Kill the transaction on remote files
If you control the code, the fix is dead simple: don't use transactions with memory-mapped files on network shares. That's the rule. Here's the step-by-step for the most common scenario—your app or database is doing this:
- Identify which file is being mapped remotely. Look for a path that starts with
\server\share\or a mapped drive likeZ:\. In SQL Server, check error logs for the exact file path. - Move the file to a local drive. If you can, shift the database or file to
C:\Data\orD:\Data\. I had a client last month whose entire print queue died because their spooler was pointed at a NAS. Moving it local fixed everything. - If you can't move it, stop using transactions. In your code, wrap the memory mapping outside the transaction. For example, in C#:
// BAD: Transaction with memory-mapped remote file using (var tx = new TransactionScope()) { var mmf = MemoryMappedFile.CreateFromFile(@"\server\share\data.bin"); tx.Complete(); // throws 0XC0190040 } // GOOD: Map first, then transaction var mmf = MemoryMappedFile.CreateFromFile(@"\server\share\data.bin"); using (var tx = new TransactionScope()) { // read/write the mapped view tx.Complete(); } - For databases like SQL Server: Check if your database files are on a remote UNC path. SQL Server does support that, but not with certain features like FileStream or memory-optimized tables inside transactions. Move those files to local storage if you see this error.
Why this happens
Windows has a feature called Transactional NTFS (TxF)—it wraps file operations in transactions so you can roll them back. But Microsoft never fully supported using memory-mapped sections on remote files inside those transactions. That's because a memory-mapped section creates a direct kernel-level mapping between the file and your process's memory. When the file is remote, the kernel can't guarantee atomicity across the network. So it throws 0XC0190040 to stop you before corruption occurs.
Short version: You're asking Windows to do something it can't safely do. Stop asking.
Less common variations of this issue
- Docker containers mapping volumes from a network share. If you're running a container that uses a mapped volume from a NAS, and the container process uses memory-mapped files inside a transaction (like some database containers), you'll hit this. Fix: use a local bind mount, not a network volume.
- Virtual machine snapshots. Hyper-V and VMware both use memory-mapped files to snapshot VMs. If the VM's VHDX is on remote storage, and the snapshot tries to use transactions (some backup tools do), you get this error. Move the VHDX to local storage for the snapshot duration.
- Custom backup scripts using Volume Shadow Copy. If you're using VSS to snapshot a remote folder and then memory-map the snapshot, the transaction can trip this error. Use a different backup method—robocopy or rsync—instead of relying on transactions.
Prevention
Keep these rules in mind so you never see this error again:
- Never mix transactions with memory-mapped files on network drives. It's not going to work. If you need both, duplicate the file locally first.
- Check your file paths. Use
GetFullPath()or verify the path is local before you start a transaction. I've seen devs assume a path likeD:\Files\is local, but D: was a mounted NAS volume. - Update your tools. Some older versions of backup software (like earlier Veeam builds) tried to map remote files inside transactions. Check for patches—most modern versions avoid this.
- Test on local drives first. When you're developing an app that uses memory-mapped files and transactions, always test on a local drive first. Add a local drive check in your code and throw a clear error if someone points it at a network path.
That's it. No magic. Just don't memory-map remote files inside transactions. Your app will thank you.
Was this solution helpful?