Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to add reference in Visual Studio 2012 'ReferenceManagerPackage'

Recently i encountered this issue whereby whenever i right-click "Add Reference..." it give me an error as stated below.

Package 'ReferenceManagerPackage' failed to load.

Attempted to reinstall Visual studio 2012 however it still doesn't work.

hasn't meet this issue before.

EDIT: 512 2013/04/14 00:49:11.860 Error VisualStudio CreateInstance failed for package [ReferenceManagerPackage] {48D4A2C1-02AD-4F18-9153-620511BACB7B}


80131522 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'.
like image 394
LZH Avatar asked Apr 13 '13 09:04

LZH


2 Answers

I just got this error after installation of Visual Studio 2017.

The solution was as follows.

  1. Launch Developer Command Prompt for VS 2017
  2. CD C:\Program Files\Microsoft Visual Studio\2017\Community\Common7\IDE\PublicAssemblies -or- C:\Program Files (x86)\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.

like image 104
SilverlightFox Avatar answered Sep 28 '22 07:09

SilverlightFox


I've just had the same error (how I got it was different) and adding the assembly back into the GAC did the trick for me. From a VS 2012 command prompt (as admin) I typed...

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

Now, my situation differs in that I had to un-install VS 2012 Update 2 (as it had messed up my source control, I couldn't check anything in). After doing a system restore to an earlier date I couldn't open the add-reference dialog in VS 2012. I hunted for this DLL on disk but it was gone, so I copied it from another machine, added it to the GAC and voila, I'm back up and running again.

like image 21
Morgan Skinner Avatar answered Sep 28 '22 06:09

Morgan Skinner