Skip to content

Could not able to copy 'obj\debug\projectname.exe to bin\deb

baskaran chellasamy

Asked May 13, 2013, 7:13 AM EDT1 answer
Share
LinkedInX
Hi friends i have two issue in my project.

1.Error143Could not copy "obj\Debug\LibrarySystem.exe" to "bin\Debug\LibrarySystem.exe". Exceeded retry count of 10. Failed.
2.Error144Unable to copy file "obj\Debug\LibrarySystem.exe" to "bin\Debug\LibrarySystem.exe". The process cannot access the file 'bin\Debug\LibrarySystem.exe' because it is being used by another process.

I have  tried with add the following in the build event.
if exist "$(TargetPath).locked" del "$(TargetPath).locked"
if not exist "$(TargetPath).locked" move "$(TargetPath)" "$(TargetPath).locked"

it worked for me once. but next time same error occur. how can solve this problem.

1 Answer

Know the answer? Post it. Somebody with the same question will find it here.

  • Rushi Daxini
    +1
    Its because of you have closed your application, but still its running in background.


    **Temporary Solution is...
    -> Go to Task Manager(Ctrl+Alt+Esc).
    -> Go to Processes tab and find "YourProjectName.exe".
    -> End Process it.


    **Permanent Solution is...
    -> You have to close your application through coding.
    -> Here is the code...


        System.Windows.Forms.Application.Exit();


    -> You have to put this code in to the form closing event in all form.
        Example:


        private void frm_menu_FormClosing(object sender, FormClosingEventArgs e)
        {
        System.Windows.Forms.Application.Exit();
        }
    +1