Click here to Skip to main content
15,795,789 members
Please Sign up or sign in to vote.
3.00/5 (2 votes)
See more:
Error saying the process cannot access the file "bin\debug\net6.0_windows\winformsapp1.exe" because it is being used by another process"

What I have tried:

I entered the task manager and completed all the operations of the program
Updated 12-Aug-23 11:16am
Richard Andrew x64 11-Jun-22 18:15pm    
What application is giving the error message? Is the error coming from Windows File Explorer? Or from Visual Studio? Where?

And WHEN does the error happen?

You must provide many more details before anyone can help you solve this.
Killua Zoldyck 2022 12-Jun-22 11:31am    
The error comes from visual studio winformsApp

Probably, it's running somewhere.
The only application you have that should be trying to open the EXE file is the compiler, or an updater - and while your exe is running it is locked by the system to ensure it doesn't change. Either that or your code is opening the file and not closing it again somewhere.

Look at when you get the error, what you were doing, what was running; it should be fairly obvious why the file is locked.

We can't do anything to help you without access to your system and code, and we have neither!
Share this answer
firstly, start up Windows task manager to check if your process winformsapp1.exe is running in the background. if it is, you can end this process and rebuild your application.

secondly, this trick may help:
Visual Studio: The process cannot access the file .dll because it is being used by another process – Zeeshan's Integration Bits[^]
Share this answer
Richard Deeming 14-Aug-23 4:26am    
You've been here long enough to know that resurrecting a 14-month old question with a link to a blog is blatant spam. If you were a new user, you would already have been reported in the Spam & Abuse forum.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900