开发者

How can I find out what process is using my file?

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' becau开发者_开发问答se 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 )

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜