none
Cannot Build VS2010 vb.net "Could not copy... being used by another process"

    Question

  • A few months ago, apparently after a round of Windows updates, I went to make a small modification to a program created in VS2010, VB.net and the build failed "Could not copy...  being used by another process".  It's trying to copy the bin\....exe to obj\....exe.

    I have tried to figure this out through many forums and can't find anything that resolves the issue.

    I created a brand new test project to see if it would happen on a new project.  First time, built, no problem.  then made a small change to the code for next test, tried to build, fail.  Same copy error.

    I used vs2010 for almost 5 years without this problem and now i cannot get anything done.

    Have gone back to writing new code in VB6 simply to be able to get things done.

    Please help !!!

     

    John Collett

    Saturday, September 24, 2016 3:36 PM

Answers

  • Hi John,

    (1) Please close all third party processes or tools like anti-virus or others.

    (2) Please disable "Enable the Visual studio hosting process" in your project property, and view the output path in your project property too.

    (3) Delete the bin/debug folder, and then re-clean and build your project, test it again.

    (4)Please make sure that it is not the configuration manager issue:

    http://www.bytemedev.com/how-to-fix-visual-studio-error-the-process-cannot-access-the-file-because-it-is-being-used-by-another-process/

    Note: This response contains a reference to a third party World Wide Web site. Microsoft is providing this information as a convenience to you.

    Microsoft does not control these sites and has not tested any software or information found on these sites;

    Therefore, Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there.

    There are inherent dangers in the use of any software found on the Internet, and Microsoft cautions you to make sure that you completely understand the risk before retrieving any software from the Internet.

    Thanks,

    Jack


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.



    Thursday, September 29, 2016 9:16 AM
    Moderator

All replies

  • I would suggest before attempting to resolve the issue any further that you download an app like LockHunter, which I have but can not guarantee it against virus or anything else, so that you can find (once Visual Studio advises that a file is being used by another process) what app or service is using the file. Without knowing that then it becomes difficult to troubleshoot much more IMO.

    It could be Visual Studio is locking the file, it could be a virus software is locking the file, it could be anything.

    Also see Build error: “The process cannot access the file because it is being used by another process” which depending on what is locking the file has various possible solutions.

    If you want code in VB for what is locking a file then I have that too and I will modify this post for a link to another thread that has that code once I find the link.

    Update: Code in post by me near bottom of this thread can detect what process or service I suppose is locking a file - Read Only filestream is locking out file.


    La vida loca

    Saturday, September 24, 2016 5:02 PM
  • Thanks for your help.

    I downloaded LockHunter and it says I'm being locked by:

    devenv.exe  and vshost.exe

    I told lockhunter to "Unlock" the file and then tried to build again and got the same results.  this is really frustrating, but I appreciate the help.

    john


    John Collett

    Saturday, September 24, 2016 7:23 PM
  • Hi John,

    >>then made a small change to the code for next test

    Just from this description, could you please tell us what change have you down that lead to this issue?


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.

    Click HERE to participate the survey.

    Monday, September 26, 2016 8:58 AM
    Moderator
  • Hi John,

    (1) Please close all third party processes or tools like anti-virus or others.

    (2) Please disable "Enable the Visual studio hosting process" in your project property, and view the output path in your project property too.

    (3) Delete the bin/debug folder, and then re-clean and build your project, test it again.

    (4)Please make sure that it is not the configuration manager issue:

    http://www.bytemedev.com/how-to-fix-visual-studio-error-the-process-cannot-access-the-file-because-it-is-being-used-by-another-process/

    Note: This response contains a reference to a third party World Wide Web site. Microsoft is providing this information as a convenience to you.

    Microsoft does not control these sites and has not tested any software or information found on these sites;

    Therefore, Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there.

    There are inherent dangers in the use of any software found on the Internet, and Microsoft cautions you to make sure that you completely understand the risk before retrieving any software from the Internet.

    Thanks,

    Jack


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.



    Thursday, September 29, 2016 9:16 AM
    Moderator