Error HRESULT E_FAIL has been returned from a call

2020-02-17 07:03发布

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.

24条回答
走好不送
2楼-- · 2020-02-17 07:48

This is a security and permissions issue. Look into the IIS and make sure Integrated Security is ON. Then set Application Protection level to Medium (If it is high then this might be the result). Then check your Web.Config file. Make sure impersonation is off.

This should help.

查看更多
戒情不戒烟
3楼-- · 2020-02-17 07:49

I received this error recently in VS 2013 for a Silverlight 5 project. None of the above worked for me. Oddly enough, it was a threading problem (normally I am used to an exception that explains this if I am trying to create UIElements on a background thread by mistake).

Wrapping my code that adds UIElements to the MainPage with Dispatcher.BeginInvoke solved the problem:

 Dispatcher.BeginInvoke(() =>
 {
      // your code
 });
查看更多
萌系小妹纸
4楼-- · 2020-02-17 07:49

In my case it was, when I tried to import database into the SSDT project, but this database already was in project, but was empty. I've just updated my project with Tools -> SQL server -> New schema comparsion. Source - database, target - project. Compare - update.

Hope it helps to someone

查看更多
放我归山
5楼-- · 2020-02-17 07:50

I had this error in my xaml page and there were no syntax errors. Cleaning and re-building the project solved my issue. fyi...

查看更多
走好不送
6楼-- · 2020-02-17 07:51

Here is what FINALLY fixed this problem for us when trying to use MICROSOFT.TEAMFOUNDATION library when querying Team Foundation Server:

  1. Team Foundation Explorer has to be installed with the currect version that is referenced in the application.
  2. MSDTC – Configuration. (See DTC config below)
  3. IIS App Pool has to run as an account that has query access to the Team Foundation Server
  4. IIS App Pool has to run as an account that has COM access on IIS Server (We have a dedicated server for this so we made the identity user an administer on the local server).
  5. Firewall has to be off or configured to allow COM access for DTC service.

DTC config ----

  1. Click Start, click Run, type dcomcnfg and then click OK to open Component Services.
  2. In the console tree, click to expand Component Services, click to expand Computers, click to expand My Computer, and click to expand Distributed Transaction Coordinator.
  3. Right click Local DTC, and click Properties to display the Local DTC Properties dialog box.
  4. Click the Security tab.
  5. In the Security Settings section, click Network DTC Access.
  6. In the Client and Administration section, select Allow Remote Clients and Allow Remote Administration.
  7. In the Transaction Manager Communication section, select Allow Inbound and Allow Outbound.
  8. In the Transaction Manager Communication section, select Mutual Authentication Required (if all remote machines are running Windows Server 2003 SP1 or Windows XP SP2 or higher), select Incoming Caller Authentication Required (if running MSDTC in a cluster), or select No Authentication Required if some of the remote machines are pre-Windows Server 2003 SP1 or pre-Windows XP SP2. No Authentication Required is the recommended selection.

I hope this helps.

查看更多
成全新的幸福
7楼-- · 2020-02-17 07:51

Well, I was almost going to eat my computer.. At last, I find out the problem is that I MAYBE BY ACCIDENT removed one parameter of one Margin setting of an Image object in the XAML page, orz..

Margin="0,-20,0" 

which should be

Margin="0,-20,0,0" 

Obviously I didn't realized I have ever modified anything of the XAML, so I have been troubleshooting the code behind for "a little while"..

Fortunately, I found this post and rechecked everything include the XAML page.. that was ... something...

查看更多
登录 后发表回答