“Error HRESULT E_FAIL has been returned from a call to a COM component” windows forms c#

10,097

Also had this problem.

As said in the comments, the solution was to track down a reference to the project itself and get rid of it - there's no sense behind it.

It was a bit tricky to find it first since the reference name changed meanwhile and was not the same as the project anymore, so make sure to keep that in mind.

Share:
10,097
Patricio Diaz
Author by

Patricio Diaz

Updated on July 20, 2022

Comments

  • Patricio Diaz
    Patricio Diaz almost 2 years

    I am making a desktop application in windows forms and i dont know why appear the error:

    “Error HRESULT E_FAIL has been returned from a call to a COM component”

    On the designer of all my user controls and windows.

    I know that are others threads with this problem but i checked them and i didnt get a solution.

    I tried deleting ProjectTemplateCache and clearing the build and rebuild but it doesnt work. I read that i can delete .suo and .user files but in my project folder doesnt exists that fields. I am using Visual Studio 2015.

    Someone knows how to fix it?

  • SeraM
    SeraM over 6 years
    Removing reference (and project name changed) along with unchecking "Allow parallel project initialization". is what fixed it for me also. Design view worked in VS 2013, but not 2015. Things that also may have contributed: Upgrade to Ver 15.5.3 (the previous one was 15.5) didn't help, but it allowed me to do Tools -> Options->Projects and Solutions-> General-> uncheck Allow parallel project initialization. That plus removing the reference fixed.
  • SeraM
    SeraM over 6 years
    If you get rid of the HRESULT EFAIL message, and get a compiler warning "Unable to apply publish properties for item X", you may need to remove the reference from Publish/Application Files. See Unable to apply publish properties answer for more details.