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

后端 未结 25 1066
情书的邮戳
情书的邮戳 2020-12-24 05:01

In Silverlight 4 app; what does this error mean?:

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

It

25条回答
  •  有刺的猬
    2020-12-24 05:57

    This error seems to be a 'catch-all' for errors that otherwise are not given a specific definition or tracing, especially those having to do with relatively external Xaml code.

    In my particular case, there seemed to be an issue with the namespaces. My UserControl is in its own namespace (creatively named "UserControls"). My Pages are in their own namespace ("Pages"). I wanted to reference an enum definition in the Pages namespace from within my UserControl, so I simply added a using statement: using MySolution.Pages;. Trivial enough, and I didn't want to believe that this was the problem. But when I removed that using statement and simply created the enum in my UserControls namespace, voila, no more HRESULT error and also, as an added bonus, my dependency properties defined in the UserControl, which otherwise were mysteriously not showing up in the Xaml intellisense, suddenly were there and ready to use.

    I suspect that underlying cause for this in my case was some sort of circular reference issue. And since there was no more specific error available to relate that information to me, it simply got shuffled into this HRESULT E_FAIL Com error.

提交回复
热议问题