Coder Perfect

How can I fix the “package did not load correctly” problem in Microsoft Visual Studio?

Problem

Visual Studio 2012 and DevExpress 13.1 were installed. Visual Studio generated an error as soon as it began up, as indicated in the accompanying image.

In Visual Studio 2017, this problem also displays.

Asked by Dua Ali

Solution #1

I first saw this on a clean Windows installation with Visual Studio 2013 Ultimate Update 2 installed (although others have also reported it on Updates 3 and 4, as well as the Professional version).

To fix the issue, close all instances of Visual Studio and then delete all files in the following folder:

Visual Studio 2013

%localappdata%\Microsoft\VisualStudio\12.0\ComponentModelCache

For me, it was perfect. This information has been quite helpful.

Visual Studio 2015

%localappdata%\Microsoft\VisualStudio\14.0\ComponentModelCache

Visual Studio 2017

%localappdata%\Microsoft\VisualStudio\15.0_xxxx\ComponentModelCache

Visual Studio 2019

%localappdata%\Microsoft\VisualStudio\16_xxxx\ComponentModelCache

Visual Studio 2022

%localappdata%\Microsoft\VisualStudio\17_xxxx\ComponentModelCache

Answered by user_v

Solution #2

In Visual Studio 2017, I ran into this issue (15.7.4). After experimenting with several solutions, I found that closing all Visual Studio instances and running the following command from the command line (perhaps with administrator access) worked for me:

devenv.exe /clearcache
devenv /updateconfiguration

Answered by tdracz

Solution #3

Answered by Reza Ebrahimi

Solution #4

Using the Visual Studio Command Prompt with administrative access, run devenv /setup.

With Visual Studio 2013 Ultimate, I experienced the same issue. I tried Reza’s suggested approach, but it didn’t work.

Eventually, I was unable to shut down Visual Studio. When I tried to close it, it displayed a similar popup that wouldn’t go away. I tried it and got the following error message: “No exports matching the constraint contract name were discovered.” Neither.

“Page’somenumber’ cannot be located,” said a message in the Team Explorer box. I tried that and got the following response: Using Visual Studio 2012, page 312e8a59-2712-48a1-863e-0ef4e67961fc was not found. So I use the Visual Studio Command Prompt with administrative access to run devenv /setup.

It completed its task, and everything is now in working order.

Answered by jbarrameda

Solution #5

For Visual Studio 2017, here’s everything you need to know.

Step 1: open Visual Studio cmd in administrator mode (from the start menu, select Developer Command Prompt for VS 2017 – Make sure to use: Execute as an administrator.)

Step 2: Change directory to the Visual Studio 2017 installation folder, for example:

cd C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise

(This command can be copied and pasted into your cmd prompt.) The folder for Visual Studio Professional will be labeled “Professional” instead of “Enterprise,” and so on.)

Step 3: Copy/paste the command below.

gacutil -if Common7\IDE\PublicAssemblies\Microsoft.VisualStudio.Shell.Interop.8.0.dll

Hit Enter…

It’ll take care of the problem…

Otherwise, like above, you might add the following to the GAC:

Microsoft.VisualStudio.Shell.Interop.9.0.dll

Microsoft.VisualStudio.Shell.Interop.10.0.dll

Microsoft.VisualStudio.Shell.Interop.11.0.dll

Answered by dinesh kumar

Post is based on https://stackoverflow.com/questions/17574089/how-can-i-fix-the-microsoft-visual-studio-error-package-did-not-load-correctly