none
Help RRS feed

  • Question

  • Severity Code Description Project File Line Suppression State
    Error Unable to copy file "obj\Debug\WindowsApp1.exe" to "bin\Debug\WindowsApp1.exe". Access to the path 'obj\Debug\WindowsApp1.exe' is denied. WindowsApp1

    Why can i not run my build? 

    Regards

    Thursday, February 21, 2019 9:44 AM

All replies

  • Hello,

    Open Windows Explorer to the project folder and delete the obj folder and the bin folder. Then back in Visual Studio perform a rebuild by right clicking on the top node and select "Rebuild solution".

    Sometimes a lock is not released on one or more files in the obj folder which cause this issue. It's possible there are other reasons too but this is the first thing to try.


    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.
    VB Forums - moderator
    profile for Karen Payne on Stack Exchange, a network of free, community-driven Q&A sites

    Thursday, February 21, 2019 9:54 AM
    Moderator
  • unfortunately, this resulted in the same error.

    any other suggestions?

    Thursday, February 21, 2019 12:11 PM
  • Try configuring (and you should have this) your anti-virus software to exclude the project folder and sub folders from being scanned.

    Make sure the folder some how has a read-only attribute set via Windows Explorer, so change i.

    Make sure the app is not running externally outside of Visual Studio (it should not be since you fully deleted the obj and bin folders).

    Try cleaning the cache.

    Try restarting Visual Studio in safe mode. Then after again deleting obj and bin folder try a build again.


    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.
    VB Forums - moderator
    profile for Karen Payne on Stack Exchange, a network of free, community-driven Q&A sites

    Thursday, February 21, 2019 12:24 PM
    Moderator
  • Hi Fortnite,

    Thank you for posting here.

    Based on my search, the following link could be helpful to solve the problem.

    https://stackoverflow.com/questions/2625239/unable-to-copy-a-file-from-obj-debug-to-bin-debug

    Best regards,

    Jack


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.



    Friday, February 22, 2019 10:11 AM
    Moderator