HRESULT = '80004005' in Visual Studio 2008 Setup Project

9.8k Views Asked by At

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.

4

There are 4 best solutions below

5
On BEST ANSWER

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'

0
On

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.

0
On

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.

1
On

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.