Error HRESULT E_FAIL has been returned from a call

2020-01-27 01:58发布

I have a problem debugging a project migrated from Visual Studio 2010 to 2012. Every time I go to debug it I get the error message:

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

Compiling and running the application in a local IIS server works fine - just cannot debug.

The other change other than moving to VS2012 is I am now using Team Foundation Server for source control and issue tracking - but I cannot see how that would affect it.

I can narrow it down to the following

  • The project file - it has been migrated from VS 2003 as a website project and has been chopped and changed up the different versions
  • Crystal Report runtime library/ some other library

Anyone with any ideas?

30条回答
走好不送
2楼-- · 2020-01-27 02:06

Doh! In case anyone else gets this error when trying to attach to an IIS Website.

Triple check that your hostname is correct, I had forgotten a '/' in (e.g.) http://my.testsite.com

Try this before re-installing Visual Studio like I did.. Terrible error message..

查看更多
戒情不戒烟
3楼-- · 2020-01-27 02:06

I've gone through all the different steps on how to fix this issue with VS2019 16.2.4 and the issue still remains. I certainly hope that MS fixes this issue since this has been going on for a long time.

Just above adding to Object Browser, I couldn't work out how to Add Reference dialog in this version, since I couldn't find the GAC for 2019.

查看更多
在下西门庆
4楼-- · 2020-01-27 02:09

This solved my problem:

Start —> Run —> regsvr32 %SystemRoot%\System32\msxml3.dll

Start —> Run —> regsvr32 %SystemRoot%\SysWOW64\msxml3.dll

Before this I tried the above solution from Simon, but didn't work for me!

Perhaps combining these two solutions did the job!

查看更多
一纸荒年 Trace。
5楼-- · 2020-01-27 02:09

In my case, it appears that this message can be issued by Intellisense in Visual Studio 2013. The screenshot below shows the error at the bottom of VisualStudio 2013 after the first load of a customer project. VS2013 "ERROR-HRESULT-E Screenshot

I started googling what causes this error, and decided to try deleteing the user.vxproj files as mentioned above. I found however that the project built with no issues, then after exiting and re-loading the project, I no longer received the error. So I'm assuming in my case, it was some corruption due to moving the project from the customers directory tree structure to my local development disk tree structure. The key here is that in my case, the problem was transient. I did NOTHING and the problem appeared to resolve itself. (Not generally a desirable thing as I didn't fix anything so it might come back).

查看更多
男人必须洒脱
6楼-- · 2020-01-27 02:13

The error occurred for me after I installed the latest Windows 10 SDK. I was getting the error while building a C++ project using SDK 8.1. In Project properties, I switch to latest 10 SDK. rebuild. That worked. Changed back to 8.1. Rebuild. No error.

查看更多
做个烂人
7楼-- · 2020-01-27 02:13

My problem manifested with opening Win10 appxmanifest file (no pun intended). Simply installing Windows 10 tools and SDK (go to New->Project->Select Windows->Install Tools) fixed it.

查看更多
登录 后发表回答