0x80070020: The process cannot access the file because it is being used by another process
Another program has the file open (locked), so Windows can’t modify, delete or replace it.
Seen on:
Windows
Meaning
ERROR_SHARING_VIOLATION. Antivirus scanning, backup/sync tools (OneDrive), IDEs, servers (IIS, dev servers) or Explorer previews keep files open. During updates, security software is a common cause.
Common causes
- File open in another application or service
- Antivirus/OneDrive/indexer scanning the file
- A previous instance of your program still running
- IIS/dev server holding DLLs
⚡ Quick fix
- Find the locking process (Resource Monitor → CPU → Associated Handles, or handle.exe)
- Close it or stop the service
- Exclude build folders from antivirus/sync
Detailed fix by platform
Windows
- powershell
handle64.exe C:\path\to\file.dll Get-Process | Where-Object { $_.Modules.FileName -like '*file.dll' }
How to diagnose
- Locker — Which process holds a handle?
- Timing — During build/update/backup?
🔧 Still not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
Most viewed in Windows
Other ways to find it
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
Was this page helpful?
Report a correction or suggest an improvement
Last updated 7 Oct 2026