5

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.

Yerg
  • 277
  • 1
  • 3
  • 8
  • Do you have any cross-solution projects, i.e. a project appearing in more than one solution? Or did you move the setup project from one solution to another solution? – Dirk Vollmar Sep 02 '10 at 17:32
  • All five of the class libraries, including the main one described above, are used in many solutions. The main executable project and its respective setup project are only used in one solution. – Yerg Sep 02 '10 at 17:43

4 Answers4

3

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'

Dirk Vollmar
  • 172,527
  • 53
  • 255
  • 316
  • 1
    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 Sep 02 '10 at 17:56
  • There MUST be a better solution. What in a project file is ruined by having it used in multiple solutions? – Yerg Sep 02 '10 at 18:00
  • @Yerg: It's probably best then to use file references or to switch away from Visual Studio's setup projects. – Dirk Vollmar Sep 02 '10 at 18:28
  • 1
    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 Sep 02 '10 at 18:49
  • 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 Sep 07 '10 at 15:24
1

I experienced the same problem (Error: HRESULT = '80004005') and here is the solution.

Situation was: I was using project "x" output for deployment. Project "x" was building fine, but deployment project was failing for same project.

There were no. of other projects included in my deployment project. There is no straight way to identify the failure cause. Only method to identify the failure cause is remove the project and see if deployment project is building or not.

By this you can identify the troublesome project.

Solution is: There were no. of project included in project "x" references, but all the projects was not included in solution.

I have included reference of all referenced project and deployment project built fine.

Mick MacCallum
  • 129,200
  • 40
  • 280
  • 281
Rajender
  • 17
  • 1
0

This answer fixed this issue for me

I'm also slowly migrating all of my install projects to WIX. That seems like the best solution.

Community
  • 1
  • 1
MarkB42
  • 725
  • 9
  • 23
0

Had the same (unsolvable) problem, and Yerg's trick (just adding the files instead of the project output) saved my *. At least, the setup project builds and the installer works on my local system. Still to be tested on a customer's system..

A big thanks to Yerg.

Johan
  • 1
  • 2
    I don't get it; the setup project doesn't compile so you delete it frmo your solution. you build your solution, get the files from the release folder, add the setup project to your solution and drag&drop those generated files on the setup project? I can't do that.. – noloman Jan 20 '12 at 15:34