none
ReferenceManagerPackage fails to install, VS 2017 Community edition RRS feed

  • 質問

  • Hello - recently installed VS 2017 Community Edition. On starting a project (Console app) when I try to add a reference I get an error message saying the Reference Manager failed to load. It suggests a restart, but that doesn't help.  I also tried running "Repair" on the VS installer, still to no avail.  Here is the full error description from activitylog.xml:

    Unexpected system error mode before loading package [ReferenceManagerPackage]

    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>

    80004005 - E_FAIL

    Any help gratefully received!

    Phil

    2017年4月4日 13:12

回答

  • Hi Phil,

    Please try solution as below:

    1.Launch Developer Command Prompt for VS 2017

    2.CD
    C:\Program Files\Microsoft Visual Studio\2017\Community\Common7\IDE\PublicAssemblies

    3.Run gacutil -i Microsoft.VisualStudio.Shell.Interop.11.0.dll

    You should now see
    Microsoft (R) .NET Global Assembly Cache Utility.  Version 4.0.30319.0
    Copyright (c) Microsoft Corporation.  All rights reserved.

    Assembly successfully added to the cache

    Restart Visual Studio and hopefully all will be well and you can add references.

    The file C:\Users\USER\AppData\Roaming\Microsoft\VisualStudio\15.0_cc9cc69a\ActivityLog.xml is useful for debugging any other assemblies that may be causing the issue. Annoyingly it's very tempting to click No when asked never to see the error message again, which will suppress the error and this path so I thought I'd post it here for reference.

    Best Regards,


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


    2017年4月6日 8:02
    モデレータ

すべての返信

  • Hi Phil,

    Thank you for posting in MSDN forum.

    Please try steps as below:

    1.Close all instances of Visual Studio

    2.Delete everything in this folder:

    C:\Users\%username%\AppData\Local\Microsoft\VisualStudio\15.0_***\ComponentModelCache

    3.Reboot your computer and restart Visual Studio in Safemode:

    Navigate to path:

    C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE

    and run these commands: devenv.exe /safemode in command prompt.

    Best Regards,


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    2017年4月5日 7:46
    モデレータ
  • Thanks for your reply, but that hasn't solved the problem, I'm sorry to say.  I have also tried uninstalling and re-installing VS2017, but to no avail.

    Incidentally, after uninstalling, and before re-installing, I opened another project I already had in VS2012. Or tried to... I got a message saying that it was targeting .NET Framework .NET v4.5 which wasn't installed !!!!  It gave me the option of changing the target framework to 4.5 - but what, if any, difference is there between 4.5 and v4.5 ???

    Anyway, I re-0installed VS2017 and it solved that problem at any rate - my VS2012 projects open OK now (though the editor seems to have lost it's settings with regards which files were open.)

    SO, not terribly impressed about al that. And now I am left with a broken version of VS2017 which I can't install without buggering up my VS2012 projects!

    Unless you have at other ideas about how to fix VS2017....?

    Thanks again though

     

    2017年4月5日 9:37
  • Hi PhilUp,

    Thank you for your update.

     >>I have also tried uninstalling and re-installing VS2017, but to no avail.

    From your description, the re-installation still has problem, before installing again, please make sure that the previous corrupted one was uninstalled completely.

     Please have a try with removing the existing VS 2017 that install failed before as below:

    1. Go to Control Panel—Programs and Features, if there has ‘Microsoft Visual Studio 2017’, right click it and choose ‘Uninstall’

    2. Try to delete the following installed folders:

    3. Go to the folder: %ProgramData%\Microsoft\VisualStudio and delete the ‘Packages’ folder and ‘Setup’ folder if there has.

    4. Go to the Visual Studio installation folder (normally under %ProgramFiles(x86)%\Microsoft Visual Studio) and delete the folder ‘2017’

    After that, make sure windows update is up-to-date, clean up the %temp% folder and temporarily disable any antivirus software, reboot the computer and re-run the VS 2017 RTM installer as administrator again.

    Best Regards,


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    2017年4月6日 2:49
    モデレータ
  • Hello

    sigh... did all that, but still getting the same error. :(

    Thanks again for your time though

    Phil

    2017年4月6日 7:57
  • Hi Phil,

    Please try solution as below:

    1.Launch Developer Command Prompt for VS 2017

    2.CD
    C:\Program Files\Microsoft Visual Studio\2017\Community\Common7\IDE\PublicAssemblies

    3.Run gacutil -i Microsoft.VisualStudio.Shell.Interop.11.0.dll

    You should now see
    Microsoft (R) .NET Global Assembly Cache Utility.  Version 4.0.30319.0
    Copyright (c) Microsoft Corporation.  All rights reserved.

    Assembly successfully added to the cache

    Restart Visual Studio and hopefully all will be well and you can add references.

    The file C:\Users\USER\AppData\Roaming\Microsoft\VisualStudio\15.0_cc9cc69a\ActivityLog.xml is useful for debugging any other assemblies that may be causing the issue. Annoyingly it's very tempting to click No when asked never to see the error message again, which will suppress the error and this path so I thought I'd post it here for reference.

    Best Regards,


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


    2017年4月6日 8:02
    モデレータ
  • Hello

    I presume you meant "Program Files (x86)" in the path there.... when I run the command I get the message:

    'gacutil' is not recognized as an internal or external command, operable program or batch file.

    ...?

    *******  sorry - ignore that, I'm a wombat. Was using a Windows Command window, not the VS developer one.

    All working now

    thank you so much!

    Phil



    • 編集済み PhilUp 2017年4月6日 10:57 I'm a wombat
    2017年4月6日 10:49
  • Hi Lana,

    As you have mentioned the Log file is useful for debugging, but I had clicked on "NO" when asked never to see the error message again. Is there any possible way to undo it?

    Regards,
    SN
     

    2017年6月14日 8:31
  • I can't add references to my C# universal windows app. I tried what was posted above and all that came up was "failure adding assembly to cache: the system cannot find the file specified". I went into where the file should be located and it's definitely there.  I went into the activity log and here were the errors I got. 

    668 ERROR

    CreateInstance failed for package [ReferenceManagerPackage]Source: 'mscorlib' Description: Could not load type 'Microsoft.VisualStudio.Shell.Interop.IVsReferenceManager2' from assembly 'Microsoft.VisualStudio.Shell.Interop.11.0, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. System.TypeLoadException: Could not load type 'Microsoft.VisualStudio.Shell.Interop.IVsReferenceManager2' from assembly 'Microsoft.VisualStudio.Shell.Interop.11.0, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. at System.Reflection.RuntimeAssembly.GetType(RuntimeAssembly assembly, String name, Boolean throwOnError, Boolean ignoreCase, ObjectHandleOnStack type) at System.Reflection.RuntimeAssembly.GetType(String name, Boolean throwOnError, Boolean ignoreCase) at System.Activator.CreateInstanceFromInternal(String assemblyFile, String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, Evidence securityInfo) at System.AppDomain.CreateInstanceFrom(String assemblyFile, String typeName)

    I would greatly appreciate any/all help!!!

    2017年7月11日 14:56
  • Thanks Phil, the given solution works for me.
    2017年8月19日 13:11
  • Thank you!
    2018年1月11日 18:31
  • Hi

    I had a similar error. I have a solution created in Windows 7 and Visual Studio Community 2017 (C#) and I opened it in Windows 10 and Visual Studio Community 2017 (C#).

    I was using the Office.Excel reference in the Win7 PC. My Win10 PC did not have Office installed, so I installed it.

    When I tried to compile the solution in Win10, it failed saying that the Office reference was still missing.

    If I clicked on "Add reference..." that error window showed up.

    So, after reading these posts I added the Interop DLL with gacutil. The paths varied so you may need to look for the files as I did. Make sure to run "cmd" as an Administrator.

    C:\Program Files (x86)\Microsoft Visual Studio>dir /b/s Microsoft.VisualStudio.Shell.Interop* C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\PrivateAssemblies\Interop\Microsoft.VisualStudio.Shell.Interop.8.0.dll C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\PublicAssemblies\Microsoft.VisualStudio.Shell.Interop.10.0.dll C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\PublicAssemblies\Microsoft.VisualStudio.Shell.Interop.11.0.dll C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\PublicAssemblies\Microsoft.VisualStudio.Shell.Interop.12.0.dll C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\PublicAssemblies\Microsoft.VisualStudio.Shell.Interop.8.0.dll C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\PublicAssemblies\Microsoft.VisualStudio.Shell.Interop.9.0.dll C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\PublicAssemblies\Microsoft.VisualStudio.Shell.Interop.dll C:\Program Files>dir /b/s gacutil.exe C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin\gacutil.exe C:\WINDOWS\system32>"C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin\gacutil.exe" /i "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\PublicAssemblies\Microsoft.VisualStudio.Shell.Interop.11.0.dll" Microsoft (R) .NET Global Assembly Cache Utility. Version 3.5.30729.1 Copyright (c) Microsoft Corporation. Reservados todos los derechos. Ensamblado agregado correctamente a la caché


    2018年2月24日 0:15
  • Thank You this solved my issue. It took me a minute to find your solution but well well worth it.
    2018年5月21日 8:42
  • Many thanks, this did it for me after an hour or so of reinstalling.
    2018年5月25日 14:01
  • Thank you, this also works for me.
    2018年7月30日 8:46
  • I got this bug today 2018-10-19 with windows 10 and visual studio 2017

    As many answered here, the solution is this:

    1- Search cmd, scroll with arrow to the Developer Command Prompt for VS 2017, press ctrl-shift-enter to open in Admin mode or else it wont work.

    2- CD to C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\PublicAssemblies

    3- Run the following: gacutil -i Microsoft.VisualStudio.Shell.Interop.11.0.dll

    You can thank Rob here:

    https://developercommunity.visualstudio.com/content/problem/51166/referencemanagerpackage-failed-to-load.html

    2018年10月19日 16:24
  • do you have any thing for 2019 ?

    aws toolkit installed but cant open .



    c:\>dir /b/s gacutil.exe
    c:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools\gacutil.exe
    c:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools\x64\gacutil.exe
    c:\>
    c:\>
    c:\>dir /b/s Microsoft.VisualStudio.Shell.Interop*
    c:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\PrivateAssemblies\Interop\Microsoft.VisualStudio.Shell.Interop.8.0.dll
    c:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\PublicAssemblies\Microsoft.VisualStudio.Shell.Interop.10.0.dll
    c:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\PublicAssemblies\Microsoft.VisualStudio.Shell.Interop.11.0.dll
    c:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\PublicAssemblies\Microsoft.VisualStudio.Shell.Interop.12.0.dll
    c:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\PublicAssemblies\Microsoft.VisualStudio.Shell.Interop.8.0.dll
    c:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\PublicAssemblies\Microsoft.VisualStudio.Shell.Interop.9.0.dll
    c:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\PublicAssemblies\Microsoft.VisualStudio.Shell.Interop.dll


    c:\>
    c:\>
    c:\>"c:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools\gacutil.exe" /i "c:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\PublicAssemblies\Microsoft.VisualStudio.Shell.Interop.12.0.dll"
    Microsoft (R) .NET Global Assembly Cache Utility.  Version 4.0.30319.0
    Copyright (c) Microsoft Corporation.  All rights reserved.


    Assembly successfully added to the cache


    c:\>


    -- error

    SetSite failed for package [AWSToolkitPackage]Source: 'EnvDTE' Description: Error HRESULT E_FAIL has been returned from a call to a COM component. System.Runtime.InteropServices.COMException (0x80004005): Error HRESULT E_FAIL has been returned from a call to a COM component. at EnvDTE.Events.get_DebuggerEvents() at Amazon.AWSToolkit.VisualStudio.AWSToolkitPackage.<>c__DisplayClass67_1.<<InitializeAsync>b__0>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.VisualStudio.Threading.JoinableTask.<JoinAsync>d__68.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Amazon.AWSToolkit.VisualStudio.AWSToolkitPackage.<InitializeAsync>d__67.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.VisualStudio.Shell.AsyncPackage.<>c__DisplayClass19_0.<<Microsoft-VisualStudio-Shell-Interop-IAsyncLoadablePackageInitialize-Initialize>b__1>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.VisualStudio.Threading.JoinableTask.<JoinAsync>d__68.MoveNext() at Microsoft.VisualStudio.Services.VsTask.GetResult()


    2019年8月7日 5:42
  • I followed all steps that you mentioned. but command prompt didn't show "Assembly successfully added to the cache". It shows "failure adding assembly to the cache: The system cannot find the file specified " please reply.
    2019年9月7日 12:02
  • I tried it. and it gives me "failure adding assembly to the cache: the system cannot find the file specified. " please reply. I try to find solution 4 days, I still can't find the solution.
    2019年9月7日 13:28
  • Thank you so much. I tried to solve this problem like 4 days. after I saw your answers I tried first two solutions several times but it didn't work for me. I uninstall and reinstall visual studio 2019 and 2017 like 3 times. it didn't work too. I followed this solution step by step it really worked. Thank you again.
    2019年9月8日 20:48
  • very helpfully

    thank you my friend

    2019年10月19日 12:51