Wednesday, July 16, 2014

Unable to copy from obj\debug to bin\debug

Visual studio locked the files some time due to some reason. And you will get this error in your project.

Could not copy "obj\Debug\<Project name>.dll" to "bin\<project name>.dll". Exceeded retry count of 10. Failed. <Project name>

Unable to copy from obj\debug to bin\debug

To get rid of this problem a simple solution I found and sharing here to run the project without error.

Go to Solutions Explorer, select the project and right click on it. Go to properties option. Here you will find the Build Events.

On the Build Event there will be a space for Pre-build event command line. Go to that one and paste the following code..

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

Save it and run your project. Save some ones day..Share it...

1 comment:

  1. Hi!
    You wrote this on 2014 and to me worked on 2019...


Popular Posts