I often have this problem even when I build a new C++ project and try to build a release file.
I use Visual studio 2008. One thing that may cause this problem is my code
Go to Debug and/or Release folder(s), right click and unset, recursively, the Read-Only property.
Debug
Release
Found this tip in the MSDN Community and solved my problem!