I received a fresh laptop this week and after installing a fresh copy of Visual Studio 2017 Professional, I started getting the following error when trying to add a reference to a project.
The error read “Could not load type Microsoft.VisualStudio.Shell.Interop.IVsReferenceManager2“.
I was stunned and confused as I have never seen a error like this in a freshly installed copy of visual studio. I uninstalled and reinstalled and got the same error again. So I came to the conclusion that quality assurance is starting to degrade at Microsoft. Especially with such a basic and critical piece of functionality being broken.
Troubleshoot
I navigated to “C:\Users\{UserName}\AppData\Roaming\Microsoft\VisualStudio\15.{Id}” and opened the “ActivityLog.xml” file of the IDE in notepad++.
Inside the file you can search for the word “error” and look in the time range that you had the error. The error indicated that the dll “Microsoft.VisualStudio.Shell.
To fix this.
Close your Visual studio 2017 IDE and run the following command in the developer command prompt for VS 2017. You will need to run as Administrator to add the file to the GAC.
“gacutil -i Microsoft.VisualStudio.Shell.