none
An error occurred while validating. HRESULT = '80004005'

    Question

  • Got this error when trying to build the Setup project.  I've hunted the web and these forums.  All say it has to do with a reference problem. 

    I have determined which project is causing the problem.  Every reference in this project has either been added explicitly or as a dependent of another project.
    Tuesday, April 14, 2009 2:48 PM

All replies

  • After more investigation and experimentation, I think there is a bug in the validation.

    We have two solutions that use many of the same projects.  Each solution also includes two projects that are specific to the solution.  We have assigned the same GUID to these specific projects which resolves some reference problems, or maybe this is causing the current problem.

    The Setup project for one of these solutions works just fine.

    The Setup project for the other solution throws the HRESULT = '80004005' error when we include two of the projects.  
    These two projects reference one of the solution specific projects. 
    BUT, a third project that also references one of the solution specific projects DOES NOT cause a validation error.  However this project is included as a dependency.

    I experimented by explicitly including the third project.  "An error occurred while validating.  HRESULT = '80004005'". 

    So, there is a bug in the validation.  And the weird question is, "why does Setup for the first solution work?"
    Tuesday, April 14, 2009 2:53 PM
  • And more info...

    Just discovered that the two projects causing the validation error DO NOT HAVE ANY DETECTED DEPENDENCIES.

    When I display the Properties of the "Primary output from Spiricon.DataSource (Active)" Visual Studio lists Dependencies as (None).
    One project has 6 project references.  The other project also has 7 project references.  And that is not counting secondary dependencies.

    When I explicitly "Refresh Dependencies" they both stil say (None).

    P.S. If I right-click the project in Solution Explorer, Visual Studio shows the correct dependencies.
    • Edited by megabitee Tuesday, April 14, 2009 4:54 PM additional info
    Tuesday, April 14, 2009 4:50 PM
  • Hi Magabitee,

    Could you please tell us how to reproduce the problem in a simple scenario?

    Only if we can reproduce the problem, we could help you in addressing this problem.

    Thanks,
    Linda Liu

    Friday, April 17, 2009 3:37 AM
  • We are planning a series of 4 applications with increasing capabilities built on shared projects.  The applications will be configured in such a way that the lesser versions will disable capabilities of the more advanced versions by hiding user interface elements.

    We attempted to do this in two solutions by creating a solution specific project that had the same name, Project Guid, and Assembly Guid in each solution.

    solution1
      projectA1 specifies this is application1
      projectB
      projectC references projectA
      projectD
      etc.
      Solution1Setup

    solution2
      projectA2 specifies this is application2
      projectB
      projectC references projectA
      projectD
      etc.
      Solution2Setup

    This actually works fine when building the solutions from the IDE.

    But, there is some kind of dependency computation problem when trying to create Setups for each solution.

    Looking at "Primary Output for ProjectC" from the Solution2Setup File View there were (None).  When we looked at the Project Dependencies... for ProjectC from Solution Explorer in solution2 there were several.  In addition, when we looked at the dependencies for ProjectC from the Solution1Setup File View it showed the correct dependencies.
    If we remove and replace the reference to ProjectA in solution2, Solution2Setup builds without error but then Solution1Setup is broken in the same way.

    Friday, April 17, 2009 12:21 PM
  • Hi Megabitee,

    Based on my understanding, the projectC in solution1 and the projectC in Solution2 are the same project. In solution1, the projectC has a reference to projectA1 in solution1. In solution2, the projectC has a reference to projectA2 in solution2.

    When we add an existing project to a solution, VS doesn't copy the existing project under the directory of the current solution. Instead, it shares the same project on the disk. If we change the project in one solution, this change will be seen in other solutions that contain this project.

    In your scenario, you add a reference to projectA1 for projectC in solution1 and change the reference to projectA2 for projectC in solution2. Then if you reopen solution1, you will see the projectC has a reference to projectA2 and there's an error because solution1 couldn't find the path of projectA2.

    You should avoid doing like that.

    Thanks,
    Linda Liu

    Monday, April 20, 2009 4:43 AM
  • Your initial analysis is correct but your conclusion is wrong.

    We have assigned the same Project Guid and Assembly Guid to both projectA1 and projectA2, i.e. projectA.  projectC has a reference to projectA.  In solution1, projectC reference goes to projectA1.  When we switch to solution2, projectC reference goes to projectA2.  Remember what I said at first, THIS WORKS. 

    Regarding directory structure, VS always wants to put new projects under the solution folder.  For our common projects, we move them out to the same level as the solution.  For the specific projects, we allow VS to store them under the solution folder.  Assemblies for all projects go to the same directory regardless of solution.  Yes, you have to be careful to clean and rebuild when switching solutions but that is normal.

    But, I am getting far of track.  
    This is the forum for ClickOnce and Setup & Deployment Projects.  Therefore, my question is about a problem I am having with a Setup & Deployment Project.

    There is some kind of dependency computation problem when trying to create Setups for each solution.

    Looking at "Primary Output for ProjectC" from the Solution2Setup File View there were (None).  When we looked at the Project Dependencies... for ProjectC from Solution Explorer in solution2 there were several.  In addition, when we looked at the dependencies for ProjectC from the Solution1Setup File View it showed the correct dependencies.
    If we remove and replace the reference to ProjectA in solution2, Solution2Setup builds without error but then Solution1Setup is broken in the same way.

    Monday, April 20, 2009 12:36 PM
  • Hi Megabitee,

    Thank you for your reply!

    > When we switch to solution2, projectC reference goes to projectA2.  Remember what I said at first, THIS WORKS. 
    I still couldn't do this. Could you please tell me how you add a reference to projectA for projectC in both solutions?

    I look forward to your reply.

    Sincerely,
    Linda Liu

    Tuesday, April 21, 2009 3:19 AM
  • 1) create solution1
    2) create projectA1 in a subdirectory under solution1.  set the project output to "..\..\Assemblies"
    3) create projectC in a directory on the same level as solution1.  set the project output to "..\Assemblies"
    4) from projectC, add a reference to projectA1

    5) create solution2
    6) copy projectA1 directory under solution2, this is now projectA2
    7) add existing projectA2
    8) add existing projectC

    You can now build solution1 or solution2, both will build to the Assemblies directory.  Notice that projectA1 and projectA2 have the same name, project Guid, and Assembly Guid.   This is necessary to maintain the reference in projectC.  projectA1 and projectA2 will build only for their respective solution and can contain whatever unique behavior is desired.

    9) create setup project Setup1 in a subdirectory under solution1
    10) add "Primary output from" projectA1 and projectC
    11) clean and build solution1
    12) build Setup1, "Successful"

    13) create setup project Setup2 in a subdirectory under solution2
    14) add "Primary output from" projectA2 and projectC
    15) clean and build solution2
    16) build Setup2, "An error occurred while validating. HRESULT='80004005'"

    I created this sample as I was typing.  I received the error as described.
    Tuesday, April 21, 2009 12:40 PM
  • Hi Megabitee,

    Thank you for your reply and detailed information!

    I performed a test based on your steps. I can now build the projectC in both solutions and I can also build the Setup projects in both solutions successfully.

    Please zip your samples and send the zip file to my email box v-lliu@microsoft.com.

    Sincerely,
    Linda Liu

    Wednesday, April 22, 2009 4:02 AM
  • E-mail sent.  Please zip your sample and send it in a reply.

    Thank you for your help.

    Wednesday, April 22, 2009 1:04 PM
  • Hi Kurt,

    Thank you for your sample!

    I perform a test on your sample and do see the problem on my side.

    In my test, I create VS2005 projects and the problem doesn’t exist. I notice your sample are written in VS2008. So this problem only exists in VS2008.

    I suggest that you submit a bug report to the Microsoft Connect web site about this issue. As for a workaround, you can add all the assemblies the main application depends on into the Setup project manually.
    http://connect.microsoft.com/visualStudio/feedback

    If you have any concerns, please feel free to let me know.

    Thanks,
    Linda Liu

    Thursday, April 23, 2009 7:37 AM
  • Hiya

    I'm having a similar problem.  I'm also using VS 2008!  I have a class library that references two other class libraries in the same solution.  The really annoying thing is that this setup project has been working, producing msi's and I have been installing then successfully for weeks.  Part way through today I got this error and got stuck.  To try to fool VS 2008 I've even tried making a new class library with a new name, creating the files in it and copying and pasting the code and it still won't work. I have tried added the primary outputs from the dependant library projects explicitly as well.

    Does anyone have any other suggestions for a work around?  Thanks :)
    Thursday, April 23, 2009 4:19 PM
  • I have reported this on Connect here - https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=434732

    If you are also having the same problem please visit the bug report above and cote for it!!  Thanks :)
    Michelle Richardson - Software Developer
    Thursday, April 23, 2009 4:47 PM
  • Thursday, April 23, 2009 4:55 PM
  • I would also need an answer or solution for this. I do not find anythingfor this in connect url. Please help.


    Anuj : Qcode
    • Proposed as answer by BitcoSoftware Friday, October 23, 2009 12:07 AM
    Tuesday, June 30, 2009 6:41 PM
  • Ok, I had the same problem.  I worked on this for like 8 hours.... couldn't figure out what was wrong.  So I decided to shut down Visual Studio, and then Re-Open the solution and the problem went away.  I hope this helps someone.

    Friday, October 23, 2009 12:08 AM
  • I had the same problem a few minutes ago.  The build was working fine yesterday and then today I would get the error 'An error occurred while validating. HRESULT = '80004005'' when trying to create the setup project.

    After reading this article I looked around and discovered that my start-up project had two dependencies that were not really there so they had little red x icons on them. I removed these but still had the problem.  I restarted Visual Studio and still had the problem and right-clicking Detected Dependencies would result in nothing showing up under that folder.

    Next, in my start-up project I removed a reference to a valid project I wanted in there and added it back in to see if that would help VS sync back up. As I did this I noticed that there was one reference in my start-up project that wasn't flagged red, but also wasn't a project actually included in my solution. I included it in a previous build, but didn't want it in this build and had removed the project and cleaned the output directory so the DLL was no where to be found. Once I removed the unwanted reference that wasn't flagged by VS to be out of place it started building just fine again.

    Hopefully this will save someone some time in the future.
    Wednesday, November 18, 2009 6:15 PM
  • I continue to have this problem after removing/re-adding all projects and references, and closing/opening VS 2008. My solution only has 5 projects and only the startup project depends on the other 4 (none of them depend on each other). All 5 projects are under the solution in the FS.

    One strange thing I've noticed is that when the Setup Project contains only my Startup Projects primary output, there are NO detected dependancies. If I add the Primary Output of any of the other projects, the .net framework shows up as a dependancy.

    That provide a clue as to what my problem might be? I also suspect (can't say why to be honest), that my project references aren't quite as they should be, or at least ideal. The app runs fine, but the references point to specific DLL (according to the solution configuration selected) and "Copy Locally" is true. I want to say this hasn't been the case in the past, but I'm not sure.
    Thursday, January 28, 2010 1:02 AM
  • Basically MS said that they do not support my design even though their tool allows it and is broken in that way.  i.e. I need to make the changes
    Thursday, January 28, 2010 3:13 PM
  • I believe I found the cause. I tried to open the Project in VS 2010b2 (to let it upgrade) hoping it might find or overlook the problem. What I think I found was that some file/folder in my solution was read-only. I pulled up the properties on the solution folder, cleared the dot (not checkmark) in the read-only option, applied to all files/folders, then reopened the solution. Was able to build then.

    Given the inconsistency I saw before I can't say for sure that was the problem, but it seems reasonable.
    • Proposed as answer by Michael_R. _ Thursday, January 28, 2010 9:02 PM
    Thursday, January 28, 2010 9:02 PM
  • I have the same problem as megabitee. Michael_R. solution didn't work for me.
    Wednesday, April 14, 2010 2:35 PM
  • I have the same problem!! The problem occurred in Visual Studio 2010
    Friday, May 28, 2010 1:37 PM
  • Jader -- what version of Visual Studio are you using?

    RobinDotNet


    Click here to visit my ClickOnce blog!
    Microsoft MVP, Client App Dev
    Friday, May 28, 2010 11:39 PM
    Moderator
  • I also had the same problem and I solved it by making sure that the projects did not add cross dependencies, if i may call them that, in that ensure that if a project is referenced once already, and the project referencing it is already added in the setup project, you do not need to add the referenced project in the setup.

     

    Once i did this, the error disappeared and I was able to successfully build the setup.

    Friday, June 18, 2010 10:51 AM
  • I've got the same HRESULT = "80004005" error in a vs2008 solution where a .csproj was previusly opened and saved with vs2010.

    Vs2010 changed the ToolsVersion attribute from the original "3.5" to "4.0"  so that the setup project failed to validate the .csproj xml.

    I've changed back ToolsVersion="4.0" to ToolsVersion="3.5" in the .csproj file to fix the problem.

    I hope this help.

    Bye,

    Francesco

    • Proposed as answer by fmaragno Thursday, July 29, 2010 4:46 PM
    • Unproposed as answer by RobinDotNetMVP, Moderator Friday, July 30, 2010 5:56 AM
    • Proposed as answer by mluloh Tuesday, August 10, 2010 2:29 AM
    Thursday, July 29, 2010 4:45 PM
  • I've got the same HRESULT = "80004005" error in a vs2008 solution where a .csproj was previusly opened and saved with vs2010.

    Vs2010 changed the ToolsVersion attribute from the original "3.5" to "4.0"  so that the setup project failed to validate the .csproj xml.

    I've changed back ToolsVersion="4.0" to ToolsVersion="3.5" in the .csproj file to fix the problem.

    I hope this help.

    Bye,

    Francesco

    This definitely solved my problem.

    I added a reference to aclass library developed using VS2010 to another class library that's developed using VS2008. I opened the .csproj file of the former, changed the ToolsVersion to "3.5" and the problem was solved.

     

    • Proposed as answer by Ken Bonnin Jr Tuesday, September 28, 2010 5:17 PM
    Monday, August 23, 2010 8:00 AM
  • Thanks for the solution, in my case was added as a reference project which were opened in VS2010, was to change the value of "ToolsVersion" to 3.5 of the project files and the problem was resolved.

    Thank you very much :D
    Wednesday, August 25, 2010 11:37 AM
  • fmaragno,

    That helped and saved me a lot of time. Thanks a lot !

    Wednesday, September 15, 2010 4:59 PM
  • BINGO! Much thanks for the ToolsVersion -> 3.5 solution.
    • Proposed as answer by jayita Monday, March 14, 2011 10:01 AM
    Tuesday, September 28, 2010 5:18 PM
  • fmaragno,

    Thanks I was stuck on this for 3 days trying to solve this issue.

    • Proposed as answer by jayita Monday, March 14, 2011 10:01 AM
    Saturday, October 09, 2010 3:07 PM
  • Another cause of this problem is renaming a project after it has been built once.  (Visual Studio 2008)

    Say the original project and exe was something like "MyCOolProject"  and the new one was "MyCoolSoftware".  The original exe will hang around in the bin folder and the setup progam will see it and try to resolve its dependencies causing the error.

    The solution in my case was

    1. Remove the setup project from the solution
    2. Delete (through Windows) the bin and obj folders
    3. Delete the setup project. 
    4. Create a new setup project
    • Proposed as answer by jayita Monday, March 14, 2011 10:01 AM
    Friday, October 15, 2010 2:08 PM
  • Problem :

    1 ERROR: An error occurred while validating.  HRESULT = '80004005'

    2 No Dependencies appear in the SET UP Project.

    3. In the Build Output ( it shows tools version 4.0 not found and hence treating as 3.5 ) Thats the catch !!

    Change ToolsVersion from 4.0 to 3.5 and bingo !! it works like a charm.

    Regards

    Pradeep

     

     

    • Proposed as answer by jayita Monday, March 14, 2011 10:00 AM
    Thursday, December 16, 2010 5:57 AM
  • I have also had this problem. Looking at my build output I spot the warning about ToolsVersion="4.0". It seemed a colleague had opened the project (which is used in various solutions) with VS 2010 and accidentally checked it in, rather than using the VS2010 version of the csproj file.

    Rolling these csproj files back to their earlier VS 2008 version solved it for me. See my blog for a detailed description.

     

    Regards,

    Michael


    ----- http://jepsonsblog.blogspot.com -----
    Thursday, December 30, 2010 8:55 AM
  • Microsoft:

    Im very surprised, that you can't reproduce this error, is very easy...occur when we have a solution with many projects and we have installed more than one version of VisualStudio.. i.e. 2010 and 2008 at the same time.

    The solucion is very simple, is modify all project files changing

    ToolsVersion="4.0" toToolsVersion="3.5"
    <BootstrapperPackage Include="Microsoft.Net.Client.4.0"> to
    <BootstrapperPackage Include="Microsoft.Net.Client.3.5">
    or the version that you need

    It taked me about 4 hours for fix this problem.
    I hope that is util for you..


    Kind Regards,
    sorry for my bad english
    • Proposed as answer by jayita Monday, March 14, 2011 10:00 AM
    Friday, January 21, 2011 12:20 AM
  • Microsoft:

    Im very surprised, that you can't reproduce this error, is very easy...occur when we have a solution with many projects and we have installed more than one version of VisualStudio.. i.e. 2010 and 2008 at the same time.

    The solucion is very simple, is modify all project files changing

    ToolsVersion="4.0" toToolsVersion="3.5"
    <BootstrapperPackage Include="Microsoft.Net.Client.4.0"> to
    <BootstrapperPackage Include="Microsoft.Net.Client.3.5">
    or the version that you need

    It taked me about 4 hours for fix this problem.
    I hope that is util for you..


    Kind Regards,
    sorry for my bad english

    This was a quick and easy to understand solution for the error "<Setup Project> An error occurred while validating. HRESULT = '80004005' " which came up while I was testing compatibility.

    I could easily see that the dependancy were not detected by the Setup Project;

    Following the advice above, I just opened the just opened the .vbproj in notepad, made the edit, and saved.

    The VS IDE immediately asked to ReLoad; I confirmed and I was good to go.

    Thanks.


    FirstMalone
    Monday, May 23, 2011 6:04 PM
  • This is bit old post. If anyone gets this problem then try with restarting the Visual Studio.

    Whenever I gets this problem I just restart the Visual Studio and it seems to be solved the problem.

    Thursday, September 08, 2011 1:44 AM
  • It seems that for me (working with VS2010 on an old project) this resulted from a strong name key (pfx). One project involved had a key for which I do not have the pass phrase. After setting a new key things work fine now.
    Wednesday, September 28, 2011 5:39 PM
  • I solved this error with a similar approach.

    Select the project node. In the "Project" menu, click "Show all files".

    In the project tree, open the "References" node and remove all references with warnings (yellow exclamation marks). Also remove all unused references.

    Afterwards I could build the setup

    Tuesday, August 28, 2012 3:32 PM