I tried several solutions that you provided, but occasionally I still receive this error. I am positive that my process is not running, and when i try to delete the executable file with internet explorer it is removed from the file list, but then I press F5 and voila, the file is back. It has not been deleted at all.
But if i delete the file through the TotalCommander, the exe file is actually deleted and I can successfully build the project.
I am using windows 7 x64 and total commander 7.56a 32 bit.