How to stop Windows Task Manager from interfering with VS build

Hong 1,246 Reputation points
2024-05-10T15:55:53.4466667+00:00

I often get the following error after an app under debugging crashes:

DEP1000: Cannot copy file "E...\MY_APP\bin\x64\Debug\MY_APP.exe" to layout "E...\MY_APP.UWP\bin\x64\Debug\AppX\entrypoint\MY_APP.exe". IOException - The process cannot access the file 'E...\MY_APP.UWP\bin\x64\Debug\AppX\entrypoint\MY_APP.exe' because it is being used by another process. [0x80070020]

The remedy is closing Windows 11's Task Manager. Is there a way to prevent the Task Manager from interfering with the build process?

Developer technologies | Visual Studio | Debugging
0 comments No comments
{count} votes

Accepted answer
  1. Anna Xiu-MSFT 31,056 Reputation points Microsoft External Staff
    2024-05-13T08:00:15.8133333+00:00

    Hi @Hong, 

    Welcome to Microsoft Q&A! 

    You can enable Task Manager Efficiency mode to reduce process interference. 

    Furthermore, you can use the Process Explorer or File Locksmith tools to check what process is locking the file. 

    Besides, for the issue, you can close all running VS instances and manually delete the bin and obj folders in your project folder. Then, re-launch the VS. 

    If you have any anti-virus software, please temporarily disable it. 

    Sincerely,

    Anna


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".  Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.