I'm trying to delete some file on my code. But I get an io exception and a message of
"the process cannot access the file because it is being used by another process"
Is there some way to know which process hold a handle to this file?
I'm trying to delete some file on my code. But I get an io exception and a message of
"the process cannot access the file because it is being used by another process"
Is there some way to know which process hold a handle to this file?
Use something like the following application to query which process has a handle on the files you are trying to delete.
If you want to check this from your code then you can use handle.exe https://technet.microsoft.com/en-us/sysinternals/bb896655.aspx And you will find example on how to use it in Gennadys answer here: How do I find out which process is locking a file using .NET?