VS2010 running on Windows7x64
I am trying to do a build of a VS2010 console application, and sporadically get this error:
Could not write to output file
'D:\somepath\someProjectName\obj\Debug\ProjectName.exe' -- 'Access is denied. '
Using Sysinternals ProcessExplorer, I can see a handle to that file, but when I click on it, no application is shown holding it, and when I try to close the handle, I get a "Error opening process: the handle is invalid." error in ProcessExplorer.
If I go to the folder in windows explorer, I can physically delete the file (so it seems), but the lock still persists, making me think it perhaps didn't actually delete, perhaps it is just pending deletion?
Is this a known bug, something I am doing wrong, other?
Is there a utility that can force this file to be unlocked?
See here for possible solutions:
Visual Studio build fails: unable to copy exe-file from obj\debug to bin\debug