I know this has been discussed a lot of time, but their answers did not help me.
When I build the project it gives the following error:
The process cannot access the file '..\MyProjectFolder\obj\x86\Release\MyProject.exe' because it is being used by another process.
What I've tried so far:
- Closed Visual Studio 2010, and opened it again.
- Opened task manager (as administrator), no process running, named "MyProject.exe"
- Run SysInternals\handles.exe (as administrator again), there is no application having a handle to MyProject.exe. (strange!)
- Run SysInternals\ProcessExplorer.exe, searched the process name, no handle. (how come!)
- Killed the explorer.exe, and re-run. No luck.
- Tried to delete the file manually, from command line. Same error (being used by another process).
- Logged out and logged in, still the same issue.
- Restarted the machine, yes it works, but not the desired answer :).
I'm really wondering the reason behind. This is the second time I experience this, I don't want to restart the machine again.
All aside, how come ProcessExplorer.exe or handles.exe not show the handle! I lost my faith..
Something very similar is discussed in the following links (even more!), but none of them helped me (or maybe I couldn't find the right one):