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

    Question

  • I am receiving the following error:

    "Error HRESULT E_FAIL has been returned from a call to a COM component."

    This error occurs at design time. It blocks building so I can't test the runtime.


    I am using VS2010 wSP1 and Expressions 4. The Silverlight application I am writing is not complicated and does not use RIA or other services. Though simple it fails when the SL4 application imports the SL4 library and populates a List<> collection within the constructor (the list exists within the same class). The issue persists even when all library code is moved into the application, making it an SL4 application with an unmodified web host.

    This application consists of three projects: an SL4 library, an SL application and an SL web.

     

    To resolve this I have:

    • removed and reinstalled project references
    • cleaned the solutions and deleted bin and obj folders
    • deleted the C:\Users\<user>\AppData\Local\Microsoft\Expressions folder
    • uninstalled and reinstalled Expressions 4
    • uninstalled and reinstalled Silverlight 4 Toolkit - April 2010.msi
    • installed Silverlight 5 Tools for Visual Studio 2010 - Silverlight5_Tools.exe
    • Looked to delete the ServiceReferences.ClientConfig file but couldn't find one. I read about this solution on a blog.
    • Added <identity impersonate="true" /> to the web.config

    Everything was working until the system forced an update in the SL browser addin. Shortly thereafter the issue occurred and will not go away (oddly, it affects design time whereas the browser addin is not used until runtime). I am wondering about the corruption of shared libraries (reinstallation did not resolve this).

    Nothing has worked. So, I am looking for other solutions.

    How can this problem be resolved? Please help if you can.


    Many thanks!


    • Edited by MycroftSqrd Friday, November 11, 2011 1:17 PM Correction
    Friday, November 11, 2011 1:16 PM

Answers

  • For any who are interested, I found my issue... The error message does nothing to assist in identifying the problem but because the application was so simple I just kept rearranging it and stumbled across the cause.

    The problem was with Listbox item templates that were moved from local resources into a resource file. The templates contained buttons with event handlers that map to methods in the local class. When the templates were moved to the shared resource file the links could not be resolved and the worthless HRESULT E_FAIL error was thrown.

    I hope you never encounter this error message but if you do I hope my solution helps.

    God's blessings always!

    “One who puts on his armor should not boast like one who takes it off.”

    -- NIV Bible - 1 Kings 20:11

    • Marked as answer by MycroftSqrd Friday, November 11, 2011 8:37 PM
    Friday, November 11, 2011 8:35 PM

All replies

  • For any who are interested, I found my issue... The error message does nothing to assist in identifying the problem but because the application was so simple I just kept rearranging it and stumbled across the cause.

    The problem was with Listbox item templates that were moved from local resources into a resource file. The templates contained buttons with event handlers that map to methods in the local class. When the templates were moved to the shared resource file the links could not be resolved and the worthless HRESULT E_FAIL error was thrown.

    I hope you never encounter this error message but if you do I hope my solution helps.

    God's blessings always!

    “One who puts on his armor should not boast like one who takes it off.”

    -- NIV Bible - 1 Kings 20:11

    • Marked as answer by MycroftSqrd Friday, November 11, 2011 8:37 PM
    Friday, November 11, 2011 8:35 PM
  • For any who are interested, I found my issue... The error message does nothing to assist in identifying the problem but because the application was so simple I just kept rearranging it and stumbled across the cause.

    The problem was with Listbox item templates that were moved from local resources into a resource file. The templates contained buttons with event handlers that map to methods in the local class. When the templates were moved to the shared resource file the links could not be resolved and the worthless HRESULT E_FAIL error was thrown.

    I hope you never encounter this error message but if you do I hope my solution helps.

    God's blessings always!

    “One who puts on his armor should not boast like one who takes it off.”

    -- NIV Bible - 1 Kings 20:11


    Excellent....Been fighting for 3 days over this..Re installed vs, which worked for a couple of hours etc....and it came back..Nice
    Sunday, January 08, 2012 4:21 PM
  • Hi MycroftSqrd,

     

    Thank you for the insight. How would one be able to resolve this issue? I am encountering the exact same scenario as you had described.

     

    Cheers.

    Wednesday, January 25, 2012 6:58 PM