Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"ExtensionManagerPackage" did not load correctly

I have downloaded Visual Studio 2017 on one of my machines with Windows 7, SP 1, and at some point setup has failed. There was an error about installing Windows 10 SDK. According to Microsoft site, this is a bug, and a solution is to download Windows 10 SDK separately and install it like that.

Now when I did that, on first run of VS, I got next error:

The 'ExtensionManagerPackage' package did not load correctly...Restarting Visual Studio could help resolve this issue.

Suggested restarting didn't change anything.

There were few more errors like this on startup (packages related errors). Now I am re-installing, and will try to choose different Workloads to see if this happens for every workload...

If matters, I have installed the Universal Windows Platform development, .NET desktop development and Windows desktop development with C++ workloads.

This is what I get from ActivityLog.xml file (located in VisualStudio\15.0_0b1e9ecf\ folder:

SetSite failed for package [ExtensionManagerPackage]Source: 'Microsoft.VisualStudio.ExtensionManager.Implementation' Description: Could not load type 'Microsoft.VisualStudio.Shell.IOleMenuCommand' from assembly 'Microsoft.VisualStudio.Shell.Interop.8.0, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. System.TypeLoadException: Could not load type 'Microsoft.VisualStudio.Shell.IOleMenuCommand' from assembly 'Microsoft.VisualStudio.Shell.Interop.8.0, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. at Microsoft.VisualStudio.ExtensionManager.VSPackage.ExtensionManagerPackage.d__27.MoveNext() at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine](TStateMachine& stateMachine) at Microsoft.VisualStudio.ExtensionManager.VSPackage.ExtensionManagerPackage.InitializeAsync(CancellationToken cancellationToken, IProgress`1 progress) at Microsoft.VisualStudio.Shell.AsyncPackage.<>c__DisplayClass16_0.<b__1>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at Microsoft.VisualStudio.Services.VsTask.RethrowException(AggregateException e) at Microsoft.VisualStudio.Services.VsTask.InternalGetResult(Boolean ignoreUIThreadCheck) at Microsoft.VisualStudio.Services.VsTask.GetResult()

along with:

End package load [ExtensionManagerPackage]

Is this also a known bug? Anybody experienced this?

like image 429
Whirlwind Avatar asked Apr 14 '17 21:04

Whirlwind


2 Answers

I registered just to answer this because i spend 2 hours trying to resolve it, and this may save someone some time. I had the same problem with the "package didn't load correctly" but on visual studio community 2007.

In my case it was because of a conflict of a file added from microsoft office 2017.

You can try the following solutions A. Close the program, go to C:\Users\\AppData\Roaming\Microsoft\VisualStudio and delete the 11, or 12, or 14 or 15XXX folder. Restart Visual studio which will recreate the folder and thankfully will work correctly (this didn't work for me)

B. There is a file that is from office 2007 inside windows/assembly/gac that needs to be replaced with a newer version. Thankfully this file is already on the installation location of visual studio.

The offending file is Microsoft.VisualStudio.Shell.Interop.8.0.dll

Problem is that on windows 10 there is no way to do any file operations inside the assembly folder. To bypass this limitation open a elevated command line and paste the following command

Depending of the version of visual studio and the location when you have installed the program this command has to be modified accordingly.

copy /-Y "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\PublicAssemblies\Microsoft.VisualStudio.Shell.Interop.8.0.dll" C:\Windows\assembly\GAG
like image 102
GeorgeMichalis Avatar answered Oct 24 '22 04:10

GeorgeMichalis


I was finally able to get past this by following: https://developercommunity.visualstudio.com/content/problem/26746/getting-errors-when-starting-vs2017-ide.html

I went with the method in the comment"

"Another way that worked for me was just to replace the dll in GAC with the one from VS2017 PublicAssemblies folder... Less steps, still gets it done... :)"

like image 24
fpolaski Avatar answered Oct 24 '22 04:10

fpolaski