It's the famous
"Unable to copy file "obj\Debug\MVP.exe" to "bin\Debug\MVP.exe". The process cannot access the file 'bin\Debug\MVP.exe' because it is being used by another process."
message again. Visual Studio Enterprise on Windows 7 64bit. These are the steps to reproduce:
- I build a solution (F6) Build finishes with no errors.
- I notice a small annoyance so I quickly correct it
- Press F6 to build again, but now the build can't execute due to aforementioned error.
- Wait for 30 seconds
- Now I can build again
So why keeps VS this file locked for so long after the build has been completed? What can I do?
EDIT
So I check it with Process Explorer (which you can download from Microsoft). The file is sometimes in use by the process called "system". It's in use for about 30 seconds. Then "system" releases it, though the executable I'm testing might be still running. But basically, as long as process "system" is having a hold on that file, one cannot build the solution. So why is that process holding that file for 30 seconds after some rebuilds (or running it)?