When I try to build my setup project, I get the following error: "An error occurred while validating. HRESULT = '80004005'" (And Microsoft wins an award to clarity.)
I Google to find that a small army of developers have had the same problem. Really the error should read: "Could not find a reference in one of your projects." Everyone states (even on StackOverflow) how to find the project with the broken reference:
I do that, find the 80004005 error appears for my main executable project and the main class library project. Since the main executable project references the main class library project, I assume the issue is in the main class library project.
Once you find the project, people say to remove all references, and re-add them (this fixes any pathing issues that seem to be the primary cause of this error). In fact, I've done it to all projects in the solution, just for good measure. I still get the 80004005 error.
I have Googled for about five hours, I have not found any other suggested solutions. I'm almost down to remaking all 7 projects in this solution, which will take me a hours to do, and does not guarantee a result.
Suggestions are welcome before I begin sacrificing a small cuddly creatures to the Gods.
Using the same project file in more than one solution is known to cause the problem you are observing. The workaround would be to either restructure your solutions or to create separate project files.
The issue is documented in this Connect item: