admin管理员组文章数量:1405392
I'm just trying to run my windows forms code is visual studio 2022 but it keeps on saying:
Could not copy "obj\Debug\Windows form thing.exe" to "bin\Debug\Windows form thing.exe". Beginning retry 9 in 1000ms. The process cannot access the file 'bin\Debug\Windows form thing.exe' because it is being used by another process. The file is locked by: "Windows form thing (1900), Windows form thing (7644), Windows form thing (26568)"
Does anyone know a fix to this?
I'm just trying to run my windows forms code is visual studio 2022 but it keeps on saying:
Could not copy "obj\Debug\Windows form thing.exe" to "bin\Debug\Windows form thing.exe". Beginning retry 9 in 1000ms. The process cannot access the file 'bin\Debug\Windows form thing.exe' because it is being used by another process. The file is locked by: "Windows form thing (1900), Windows form thing (7644), Windows form thing (26568)"
Does anyone know a fix to this?
Share Improve this question asked Mar 23 at 12:02 new_programmernew_programmer 213 bronze badges 2- 2 This happens often if the application is still running. Just close the application window or click [Stop Debugging] (the red square icon) or hit Shift+F5 in VS. – Olivier Jacot-Descombes Commented Mar 23 at 12:15
- @new_programmer please follow steps provided in bellow different solutions, and mark one as accepted whatever answer solved your issue and close question or if still not resolve then comment here so others have idea and can suggest more solutions. – Harsh Varde Commented Apr 4 at 14:31
3 Answers
Reset to default 0Looks looks like Visual studio launches 3 processes "Windows form thing (1900), Windows form thing (7644), Windows form thing (26568)".
I think you can try following actions in order
Please stop debugging or running your current project.
If this did not help please try action 2.
In rare cases it is required to do step 2.
Close Visual studio and make sure that that processes are gone "Windows form thing (1900), Windows form thing (7644), Windows form thing (26568)". If not you can kill them manually
Start Visual Studio Again.
If you have started your program in debug mode, then stop debugging:
If you started app w/o debugging, then close your running app from app close button or from task manager, in task manager it will show same name as your project name:
If above 2 options not work then last option is restart your PC, restart always solve most issues :)
Please try the following steps to check if it works for you.
Close running app → Check Task Manager → End Windows form thing.exe.
Restart VS → Clean Solution (Build → Clean).
Delete bin & obj folders manually → Rebuild.
Disable VS Hosting Process:
Project Properties → Debug → Uncheck "Enable hosting process".
Temporarily disable antivirus (if blocking .exe).
本文标签:
版权声明:本文标题:c# - process cannot access file because it is being used by another process - could not copy obj file to bin VS 2022 - Stack Ove 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744287518a2598952.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论