In Silverlight 4 app; what does this error mean?:
"Error HRESULT E_FAIL has been returned from a call to a COM component."
It's a very generic error. The VS debugger doesn't point to the exact location of the error when debugging.
In Silverlight 4 app; what does this error mean?:
"Error HRESULT E_FAIL has been returned from a call to a COM component."
It's a very generic error. The VS debugger doesn't point to the exact location of the error when debugging.
I had this error using the current SL4 Telerik controls. A similar issue has been reported here with a solution ... of sorts. The problem seems to be with the way Expression Blend manages the cache of controls.
Most of the reason of this problem related dependency propertied on component design. You just face off this problem on design.
Soulution is easy but takes time :) Clean project and rebuild all. When you enter the desing again you should see everything is fine!
I hope this helps!
If you see this exception recently, please try to re-install silverlight sdk4.
I had this error from problems with XAML. The strange thing was that I had missing resources used by
Style
andMargin
attributes - which means the app runs fine, and even resharper only reports a 'hint'.Once I cleared up those problems my "Error HRESULT E_FAIL has been returned from a call to a COM component." disappeared. As others have said though, this is a vague error, very difficult to debug. In this case I have inherited a large project with 100's of VS and ReSharper messages with varying severity - missing
StaticResource
onStyle
attributes were not the first place I checked!Most of the times its difficult to see where exactly the problem is located especially in XAML. Another way to find out where its failing is to perform the following steps
At this point in time you have two options,
Click on the View details of the exception screen shown. Dig into the inner exceptions until you get a clue from where its originating.
View the call stack to see which code of line of your is causing this exception. This will provide clues to resolve the issue.
This is an old question but in my case, none of the above solutions worked. I was trying to update the NuGet packages in Visual Studio 2017 but I was getting the following Exception.
In fact, other NuGet commands like restore-package were failing with similar exception message.
I discovered a few assemblies were missing under the packages directory so I deleted the packages directory and returned back to the Visual Studio 2017. When I opened the solution it asked me to restore the packages and after that, I was able to update the packages.
Here's one way to generate this error, which I stumbled upon today. We have the following button in XAML:
The event handler that handles the button's
Click
event is as follows:When I click on the button I get the aforementioned error. The same error arises if I replace
NaN
withPositiveInfinity
orNegativeInfinity
.Interestingly, I get a different error message if the first parameter of the
Thickness
constructor contains theNaN
instead of the second.