How can I find out which process is using my file when I get such an error on the Build :
Error 18 Unable to copy file "Some.dll" to "bin\Debug\Some.dll". The process cannot access the file 'bin\Debug\Some.dll' because it is being used by another process.
This is definitely a trick I've had to use before.
I have all of SysInternals utilities in a folder that I've added to my PATH variable.
Specifically, you can use handle
available here to find what has the file open, then use PsKill
available here to nix the culprit!
EDIT
here's an example output
C:\Users\jschubert>handle wowza.txt
Handle v3.46
Copyright (C) 1997-2011 Mark Russinovich
Sysinternals - www.sysinternals.com
Acrobat.exe pid: 6800 type: File 284: C:\Users\jschubert\Desktop\something!\wowza.txt
C:\Users\jschubert>pskill Acrobat.exe
PsKill v1.13 - Terminates processes on local or remote systems
Copyright (C) 1999-2009 Mark Russinovich
Sysinternals - www.sysinternals.com
Process Acrobat.exe killed.
Close your application form the visual studio,
If you visual studio is not running, go to task manager and then close your program
(Sometimes your application is running not attached to visual studio )
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