I keep getting that exception in my program. How do I know which process locked it, either by program code or by doing something with windows?
System.IO.IOException : The process cannot access the file 'file.ext' because it is being used by another process.
You can use ProcessExplorer to search for the file:
Just run that (maybe you need to launch it with administrator rights), hit Ctrl-F
and type in the name of the file which is locked - it will find all open handles which match the given name, and tell you which process it belongs to.
You can use a tool like ProcessMon
to see what process is locking a file.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With