views:

40

answers:

1

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:

  1. Remove all outputs from your setup project.
  2. Add each project output individually until you see the error appear.

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.

+2  A: 

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:

An error occurred while validating. HRESULT = '80004005'

0xA3
Thank you for your clear and quick response. (Now, dear Microsoft: That seems to defeat the whole point of "reusable libraries" if I have to recreate them for each bloody solution. I have DOZENS of programs that use my libraries, and each will need to, one day, have a setup project built. It will take me **HOURS** to make a single setup project now. **This is simply unacceptable.** What if I have to make more than one setup project in a day?)
Yerg
There MUST be a better solution. What in a project file is ruined by having it used in multiple solutions?
Yerg
@Yerg: It's probably best then to use file references or to switch away from Visual Studio's setup projects.
0xA3
Best solution is to avoid the whole Primary Output thing altogether. I simply compiled release of my main executable, then dragged and dropped all release files to the setup project. BAM fixed. (Ironically, it detected the .NET Framework dependency out of the EXE!)
Yerg
Unfortunately, apparently dependencies also affect which prerequisites are installed? It detected .NET Framework as a dependency, but another Microsoft library. I did include all the prerequisites in the prerequisites tab though, which I hoped would be enough. It appears you need to have it detected as a dependency AND checked as a prerequisite for the prerequisite to be installed (?).
Yerg