Thursday, 23 October 2008

Installer Compile: An error occurred while validating. HRESULT = '80004005'


Have you ever received the message "An error occurred while validating. HRESULT = '80004005'" when attempting a compile an installer within .NET? You'll also notice that .NET provides very little information as a means to resolve this issue.

The issue is based around project dependencies. When you add a project output to an installer, you'll notice the installer automatically retrieves its dependencies (External DLLs, project references etc.). There may be a time when you remove a project from the solution, or re-locate them, by which, they can no longer be found or referenced in this case.

When compiling the project, we usually receive an error stating a project or reference cannot be found. However, when compiling an installer, we would expect to see "One or more of a project outputs project reference/s cannot be found..", however, in this case, we see "An error occurred while validating. HRESULT = '80004005'".

Hope this helps!

2 comments:

João Paulo Figueira said...

Thanks! This just saved me an hour of work...

Olivier said...

I also had an HRESULT = '80004005' error.
It was related with a new project I added in my solution.
In the output window, there were warnings about ToolsVersion 4.0 versus 3.5 .
The problem was that the new project was developped in VS2010 and that I was working with VS2008. I changed the target framework but it was not enough. I had to change the ToolsVersion value in the vbproj file and it worked!