I had this problem because different projects in a solution had the same intermediate directory.
Changing
$(Platform)\$(Configuration)\
to
$(Platform)\$(Configuration)\$(ProjectName)\
in
Configuration Properties | General | Intermediate Directory
in each of the projects solved it.