Resolved Cannot access fileName.exe because this file is being used by some other process

Anonymous

Well-known member
Joined
Sep 29, 2020
Messages
84
Programming Experience
Beginner
I am using VS 2019. All my existing applications were working fine but all of a sudden i am getting this strange error.
When i open an existing application to edit in debug mode, it works for 2 or 3 times, but then it shows this built in error when i click on run.

I then tried working in release mode, but the same thing happened, it worked fine for 2 or 3 times, then it started showing the same error for this mode also.

I have tried :

Restarting VS
Restarting System
Checked task manager but no process was running.

But this error doesn't seem to go away and i don't know how to work with my existing applications.

Please help.
 
Disable your antivirus. See if it still happens.

Run Process Explorer, and use "Find DLL or Handle" to see what is locking the file open.
 
Disable your antivirus. See if it still happens.

Run Process Explorer, and use "Find DLL or Handle" to see what is locking the file open.
Thanks, today it started working automatically. I didn't do anything. I dont know why it happened. But i have downloaded process explorer just in case it happens next time so i can monitor. Thanks a lot for guiding me.
 
I only about this because I got hit the other night by not being able to update some executable files on our Production servers. The .exe's and .dll's we all supposed being used by another process, but Task Manager was not showing them as running. About 30-45 minutes later, the files could be replaced. Investigating further the next day, I could still reproduce the problem. The files were being held by "SYSTEM" with Process ID 4. Searching on SO and the rest of web found hits for this being a common problem back around 2010-2012 and newer occurrences in 2019-2021 with Win10. Most reports were with Windows Server 2008 (my servers where Windows Server 2012) and with a particular service not running even though the service was really designed for desktop use, rather than server use. As for the newer occurrences, most people narrowed it down to antivirus software with McAfee being the top offender. My servers were running McAfee (as well as 3 other security monitoring apps).
 
I only about this because I got hit the other night by not being able to update some executable files on our Production servers. The .exe's and .dll's we all supposed being used by another process, but Task Manager was not showing them as running. About 30-45 minutes later, the files could be replaced. Investigating further the next day, I could still reproduce the problem. The files were being held by "SYSTEM" with Process ID 4. Searching on SO and the rest of web found hits for this being a common problem back around 2010-2012 and newer occurrences in 2019-2021 with Win10. Most reports were with Windows Server 2008 (my servers where Windows Server 2012) and with a particular service not running even though the service was really designed for desktop use, rather than server use. As for the newer occurrences, most people narrowed it down to antivirus software with McAfee being the top offender. My servers were running McAfee (as well as 3 other security monitoring apps).
I got this error again. The whole day vs worked fine now i got this.
I opened process explorer, and searched my .exe on thr right side filter by name textbox, but nothing came up.

Maybe im searching the wrong way. How do i figure this out?
 
Use the Find.Find Handle or DLL option on the menu bar.
 
Last edited:
Back
Top Bottom