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

sid
sid
Member
120 Points
9 Posts

When I try to Add a reference in Visual Studio Community 2019 , I got this error:

error HRESULT E_Fail has been returned from a call to a COM Component

First time I got following error:

Update:

Following is logged in activity log:

  <entry>
    <record>746</record>
    <time>2020/05/09 14:25:04.299</time>
    <type>Error</type>
    <source>VisualStudio</source>
    <description>CreateInstance failed for package [ReferenceManagerPackage]Source: &apos;mscorlib&apos; Description: Could not load type &apos;Microsoft.VisualStudio.Shell.Interop.IVsReferenceManager2&apos; from assembly &apos;Microsoft.VisualStudio.Shell.Interop.11.0, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a&apos;.&#x000D;&#x000A;System.TypeLoadException: Could not load type &apos;Microsoft.VisualStudio.Shell.Interop.IVsReferenceManager2&apos; from assembly &apos;Microsoft.VisualStudio.Shell.Interop.11.0, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a&apos;.&#x000D;&#x000A;   at System.Reflection.RuntimeAssembly.GetType(RuntimeAssembly assembly, String name, Boolean throwOnError, Boolean ignoreCase, ObjectHandleOnStack type)&#x000D;&#x000A;   at System.Reflection.RuntimeAssembly.GetType(String name, Boolean throwOnError, Boolean ignoreCase)&#x000D;&#x000A;   at System.Activator.CreateInstanceFromInternal(String assemblyFile, String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, Evidence securityInfo)&#x000D;&#x000A;   at System.AppDomain.CreateInstanceFrom(String assemblyFile, String typeName)</description>
    <guid>{48D4A2C1-02AD-4F18-9153-620511BACB7B}</guid>
    <hr>80004005 - E_FAIL</hr>
    <errorinfo></errorinfo>
  </entry>
Views: 34038
Total Answered: 4
Total Marked As Answer: 1
Posted On: 09-May-2020 05:17

Share:   fb twitter linkedin
Please, share/see activitylog.xml, here you can find the exact error
 - sam  09-May-2020 21:30
updated Sam, thanks.
 - sid  09-May-2020 21:33
Answers
sam
sam
Member
378 Points
48 Posts
         

As we can see assembly

Microsoft.VisualStudio.Shell.Interop.11.0

has issue to load.

To resolve it, follow following steps:

  1. First of all, close all the instances of Visual Studio.
  2. Open the Developer Command Prompt for VS 2019 with admin privileges, as shown in the following screenshot:
  3. Now, navigate to the "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\ Common7\IDE\ PublicAssemblies"
    1. Enter the following command in the console window:
      CD "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\PublicAssemblies"​
    2. Now enter the following command:
      gacutil -i Microsoft.VisualStudio.Shell.11.0.dll​
  4. Once you get the Assembly successfully added to the cache message in the console window (as shown in the following screenshot), start the Visual Studio 2019 instance.
  5. Now open your project and try to add the assembly reference. It will work this time.
Posted On: 09-May-2020 21:55
Thanks. It works for me.
 - sid  10-May-2020 03:10
thanks alot (issue solved) :)
 - mina kamel  02-Sep-2021 04:17
thierry joubert
thierry...
Member
10 Points
0 Posts
         

It worked for me thanks, though my install is not en.US and I had to type: 

gacutil -i Microsoft.VisualStudio.Shell.Immutable.11.0.dll​
Posted On: 12-Oct-2020 10:37
Freddy Percy Carhuachin Diaz
Freddy ...
Member
10 Points
0 Posts
         

Si me funciona gracias por el dato

Posted On: 28-Jun-2021 20:43
Ricky
Ricky
Member
10 Points
0 Posts
         

gacutil -i Microsoft.VisualStudio.Shell.Interop.11.0.dll    worked !!

Posted On: 28-Oct-2021 23:46
 Log In to Chat