title: Access denied error when trying to build VS2010 console application (Could not write to output file )
body: <p>VS2010 running on Windows7x64</p>
  
  <p>I am trying to do a build of a VS2010 console application, and sporadically get this error:</p>
  
  <pre><code>Could not write to output file 
  'D:\somepath\someProjectName\obj\Debug\ProjectName.exe' -- 'Access is denied. ' 
  </code></pre>
  
  <p>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.</p>
  
  <p>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?</p>
  
  <p>Is this a known bug, something I am doing wrong, other?<br>
  Is there a utility that can force this file to be unlocked?</p>
  
  <p>See here for possible solutions:<br>
  <a href="https://stackoverflow.com/questions/2895898/visual-studio-build-fails-unable-to-copy-exe-file-from-obj-debug-to-bin-debug">Visual Studio build fails: unable to copy exe-file from obj\debug to bin\debug</a></p>