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条回答
Root(大扎)
2楼-- · 2020-01-27 02:23

Just delete packages folder.That helped me

查看更多
小情绪 Triste *
3楼-- · 2020-01-27 02:23

Root Cause: Microsoft.VisualStudio.Shell.Interop.11.0.dll is missing from GAC.

Solution: 1. Go to start menu and Open Command Prompt for Visual Studio 2. Enter command gacutil -i Microsoft.VisualStudio.Shell.Interop.11.0.dll 3. If in case your system unable to find this dll file then you may download it from Nuget package manager and then can provide the path of dll

All set! hit enter and you're done!

查看更多
不美不萌又怎样
4楼-- · 2020-01-27 02:24

I had the same problem with a c++ project in Visual Studio 2019.

The following solution worked for me:

  • Close Visual Studio.
  • Go to the project's root folder and delete the .vs directory.
  • Start Visual Studio and open the solution.
  • The build should now work.
查看更多
The star\"
5楼-- · 2020-01-27 02:25

I had the same issue that occurred when I was working with the VS GUI tool. What I did to fix it was I deleted the local repository and pulled it down from my git source - thank you git!! :)

This may not be the solution in all instances,. but by deleting all of the local files and recompiling, I was able to get it working again!

查看更多
闹够了就滚
6楼-- · 2020-01-27 02:27

Maybe this page helps:

Scenario Two: The Microsoft Visual Studio 2010 IDE crashes while creating OR debugging a web application project. This above error occurs because of corrupted Cache of Visual Studio 2010. In order to resolve the issue just delete the project Cache from the below location:

C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\ProjectTemplatesCache

C:\Program Files(x86)\Microsoft Visual Studio 10.0\Common7\IDE\ProjectTemplatesCache

Then run devenv.exe /setup to re-build the cache.

查看更多
劳资没心,怎么记你
7楼-- · 2020-01-27 02:27

I tried all of the above solutions none work for me, I found the solution here

  • Open ActivityLog.xml by going into

    C:\Users\{UserName}\AppData\Roaming\Microsoft\VisualStudio\15.{Id} 
    
  • Check if error states that

    "CreateInstance failed for package 
    [ReferenceManagerPackage]Source: 'mscorlib' Description: Could not load type 
     'Microsoft.VisualStudio.Shell.Interop.' from assembly 
     'Microsoft.VisualStudio.Shell.Interop.11.0' 
    
  • Then run this gacutil command through VS Cmd prompt (admin mode):

    1. Navigate to

      C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\PublicAssemblies   
      
    2. Run gacutil -i Microsoft.VisualStudio.Shell.Interop.11.0.dll

查看更多
登录 后发表回答