Unable to copy file

  • Thread starter Thread starter MAF
  • Start date Start date
M

MAF

Does anyone know why in 2005 I might be getting this error everytime I try
and recompile?

Error 226 Unable to copy file "obj\Debug\myfile.dll" to
"bin\Debug\myfile.dll". The process cannot access the file
'bin\Debug\myfile.dll' because it is being used by another process. myfile
 
Hello MAF,

Seems that u have already runned instance of app that using this file
Use ProcessExplorer (www.sysinternals.com) to find the handle owner for this
dll and close it

M> Does anyone know why in 2005 I might be getting this error everytime
M> I try and recompile?
M>
M> Error 226 Unable to copy file "obj\Debug\myfile.dll" to
M> "bin\Debug\myfile.dll". The process cannot access the file
M> 'bin\Debug\myfile.dll' because it is being used by another process.
M> myfile
M>
---
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/members/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
 
VS only locks one version of the file, and you CAN rename/move it.
You can use the following commands in the pre-build event of the
problem-project to workaround the problem:

if exist "$(TargetPath).locked" del "$(TargetPath).locked"
if not exist "$(TargetPath).locked" move "$(TargetPath)"
"$(TargetPath).locked"
 
Back
Top