307

I installed Visual Studio 2012 and DevExpress 13.1. As Visual Studio started, it generated an error shown by this attached image,

The 'Microsoft.VisualStudio.Editor.Implementation.EditorPackage' package did not load correctly.

The problem may have been caused by a configuration change or by the installation of another extension. You can get more information by examining the file 'C:\Users\must\AppData\Roaming\Microsoft\VisualStudio\11.0\ActivityLog.xml'.

Continue to show this error message?

Microsoft Visual Studio - The 'Microsoft.VisualStudio.Editor.Implementation.EditorPackage' package did not load correctly.

This error also appears in Visual Studio 2017.

riQQ
  • 9,878
  • 7
  • 49
  • 66
Dua Ali
  • 3,163
  • 3
  • 19
  • 13
  • 4
    Read that error carefully: "You can get more information by examining the file ..." - what does that file say? – fvu Jul 10 '13 at 15:06
  • @fvu Activity-Log file opening error generated. – Dua Ali Jul 10 '13 at 15:20
  • 1
    One thing to check before doing deeper analysis - "Is there enough free space on the disk"? – LCJ Feb 13 '17 at 17:52
  • FYI: I had same problem in VS Pro 15.7.x - solution from @dinesh solved it for me. – qxotk Aug 21 '18 at 16:16
  • UPDATE: Opened a different project today (1 day after my prior comment above) and received the same error again. Followed the steps in solution from @dinesh below, and error went away. Don't know if it was the steps, or simply opening Visual Studio a second time. – qxotk Aug 22 '18 at 13:01
  • the same issue with VS 2022, only when I run without admin right. No solution until now. – KevinBui Apr 17 '22 at 05:25

35 Answers35

547

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

To resolve the problem, close all Visual Studio instances, then delete all files in the following folder:

Visual Studio 2013

%localappdata%\Microsoft\VisualStudio\12.0\ComponentModelCache

It worked fine for me. Thanks to this article.

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
zerocukor287
  • 555
  • 2
  • 8
  • 23
user_v
  • 9,628
  • 4
  • 40
  • 32
  • 3
    I'm having the same issue in VS 2015 but there doesn't appear to be any `ComponentModelCache` folder though. Perhaps it goes by a different name in newer versions of Visual Studio? – jpierson Jan 23 '17 at 15:52
  • 5
    @jpierson yes the folder `ComponentModelCache` for VS 2015 can be found in the folder: `14.0`. The full path is as follows: `C:\Users\\AppData\Local\Microsoft\VisualStudio\14.0\ComponentModelCache` – w0ns88 Jan 31 '17 at 12:37
  • 4
    I'm having this problem on my fresh install of Visual Studio 2017... and again, the folder structure is not the same! – Really Nice Code Mar 18 '17 at 06:15
  • 3
    Have added folder that was created for VS 2017, might want to try and see. – user_v Mar 19 '17 at 14:43
  • 1
    The following Powershell command will delete all directories within `%localappdata%\Microsoft\VisualStudio` where the directory name ends with "cache": `get-childitem -Directory "$env:LOCALAPPDATA\microsoft\visualstudio" -Include *cache -Recurse | remove-item -Recurse -Verbose` – Alex Dresko Feb 15 '18 at 19:03
  • 3
    does not help to me in VS 2017 unfortunatelly – YMC May 01 '18 at 15:31
  • Upvoted you a few years ago, 2018 we meet again with the same issue in VS2017. It's still working, thanks. – The Cookies Dog Jul 24 '18 at 07:23
  • 1
    One thing to note, if you always run VS as admin and still see the error after deleting the cache files, close all VS instances, delete cache files again, then run VS WITHOUT running as admin and let it load up. Then close it and run it as admin again. This resolved the issue for me :) – Stephen P. Oct 20 '18 at 16:33
  • I strongly recommend using the "Import/Export Settings Wizard" to export all environment settings prior to attempting this solution or any other on this page. I somehow managed to wipe out all of my user settings, but thankfully I had a backup that wasn't too old. – kmote May 29 '19 at 20:58
  • My error was "The 'formatter package' did not load correctly" and this solution fixed it. – Jeff Jul 30 '19 at 14:46
  • 10
    Worked for Visual Studio 2019: %localappdata%\Microsoft\VisualStudio\16_xxxx – Eskil Mjelva Saatvedt Oct 28 '19 at 08:12
  • Didn't work for me. What did, is disabling the "GitHub extension for Visual Studio" component. I'm using VS 2019 Pro v6.6.5 with Preview Feature "New Git user experience" enabled. Apparently the two have a conflict. You can only use one or the other anyway, so I ditched the former. – Chiramisu Jul 31 '20 at 08:25
  • Its worked for me :AppData\Local\Microsoft\VisualStudio\16.0_4c254fc3\ComponentModelCache – Javed Iqbal Jan 06 '21 at 03:53
  • 1
    i can confirm, this also works on Visual Studio 2022 – Droa Jan 11 '22 at 07:51
  • It does not work for me with Visual Studio Enterprise 2022 (64-bit) Version 17.0.6 – anastaciu Feb 10 '22 at 16:34
  • Work Visual Studio 2022 but need to open VS with administrator rights the next first time. – user1011138 Aug 21 '23 at 07:39
102

I encountered this problem in Visual Studio 2017 (15.7.4). After trying various solutions, eventually this worked for me: close all Visual Studio instances, and run this from the command line (possibly with administrator rights):

devenv.exe /clearcache
devenv /updateconfiguration
Alan Macdonald
  • 1,872
  • 20
  • 36
tdracz
  • 1,334
  • 1
  • 9
  • 4
  • 6
    This worked for me, I think there's an issue with one of the productivity power tools extensions after latest VS update – Sean T Jul 25 '18 at 08:19
  • 1
    This worked for me and I ran VS 2015 command prompt in admin mode. +1 – Jo Dar Gaya Woh Mar Gaya Sep 06 '18 at 09:26
  • 24
    Be sure to start `Developer Command Prompt for VS {version}`. `devenv.exe` is most likely not known in your normal CMD (if you haven‘t added it to the path at least). This Developer Command Prompt takes care of that. It was installed with VS and was in the start menu in my case. – bugybunny Dec 18 '18 at 10:09
  • 6
    Does anyone know what `/updateconfiguration` does exactly? – bugybunny Dec 18 '18 at 10:14
  • 2
    This worked for me, I have VS2019. Emptying cache or rewriting roaming didn't work for me – Fabrice T Oct 08 '20 at 01:05
  • Worked for me to fix the package loading errors after updating VS2019 to 16.8.1 – Pylyp Lebediev Nov 20 '20 at 12:26
  • Worked for me in VisualStudio 2019 - thanks a lot! – CodeMonga Apr 10 '21 at 07:08
  • 1
    This solution worked for me with VS 2019, whereas the answer by "user_v" with more votes did not. In my case the package name was "MyPackage" for some reason. – Architekt May 20 '21 at 15:17
  • Confirming that it worked for me too with Microsoft Visual Studio Enterprise 2019 Version 16.9.4. – Yogi Sep 18 '21 at 14:26
  • Worked for me on VS 2019 v16.11.7 – B3ret Dec 01 '21 at 04:51
  • I messed around with my GAC because System.ValueTuple would not find the correct version, and broke VS in the process. This fixed it. – AyCe May 06 '22 at 10:02
  • I was able to get things working for myself but all the projects in my solution are being marked as incompatible in the solution explorer – Krishna Oza Jun 16 '22 at 14:38
  • 2
    This worked for me on VS 2022 v17.4.4 - the `/clearcache` was quick but the `/updateconfiguration` to a bit of time. I then had to reload each of the projects in our solution. – Grandizer Jan 31 '23 at 13:07
  • 1
    Confirming that this worked for me on VS 2022 Community. – alelom Mar 21 '23 at 23:00
  • Still working on Microsoft Visual Studio Community 2022 (64 bits) - Versión 17.7.2 – javdromero Aug 28 '23 at 16:07
66
  • Close Visual Studio.

  • Backup and delete the following path:

    C:\Users\{your_username}\AppData\Roaming\Microsoft\VisualStudio\11.0

  • Restart Visual Studio as Admin. Otherwise, the Roaming folder can't be repaired by Visual Studio.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Reza Ebrahimi
  • 3,623
  • 2
  • 27
  • 41
  • 2
    This worked with visual studio 2015 community edition also. The path changes to `C:\Users\{your_username}\AppData\Roaming\Microsoft\VisualStudio\14.0`, but it works just the same. Also, before opening visual studio, I ran the `devenv /setup` command suggested by @J-B – flaria Jul 11 '16 at 20:25
  • 2
    The solution proposed by @user_v is a little less abrasive, as it only deletes the problem folder not the whole thing. – Cody Jul 19 '16 at 20:26
  • It worked for me. But After deleting the mentioned files, I run `devenv /setup` command in `Command Prompt for VS2015`. It caused the deleted files to be created again. then I run the Visual Studio ;) – Siyavash Hamdi Jun 20 '17 at 20:35
  • There was not a VisualStudio folder there for me (VS Pro 2017). I deleted `C:\Users\{your_username}\AppData\Local\Microsoft\VisualStudio\15.0_xxxx` and started in Administrator mode and it worked. – Nick Graham Nov 06 '18 at 16:08
  • 1
    I was getting this with the "Roslyn" package in Visual Studio 2022. None of the other solutions here worked. This fixed it though – Joe Oct 28 '22 at 16:27
34

Try devenv /setup on the Visual Studio Command Prompt with administrative rights.

I had the same problem with Visual Studio 2013 Ultimate. I tried the solution by Reza posted here, but it didn't work.

Eventually I couldn't close Visual Studio. It was showing a similar dialog when I tried to close, and it wasn't closing. I tried this: Error message "No exports were found that match the constraint contract name". Neither.

I noticed a message in the Team Explorer window saying "Page 'somenumber' cannot be found". I tried that way, and I found this answer: Page '312e8a59-2712-48a1-863e-0ef4e67961fc' not found using Visual Studio 2012. So I run devenv /setup on the Visual Studio Command Prompt with administrative rights.

It did the job, and everything is fine now.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
jbarrameda
  • 1,927
  • 2
  • 16
  • 19
  • Microsoft does not give lot of details of what `devenv /setup` does. Just that it is the last step of the installation process. http://msdn.microsoft.com/en-us/library/ex6a2fad.aspx – jbarrameda Apr 18 '14 at 17:33
  • Props for the link to the "constraint contract name" question. That's what actually fixed my issue. Thanks for including it. – user4593252 Mar 22 '16 at 13:38
  • 4
    In my case `devenv.exe /resetuserdata` helped. Note: it resets *ALL* user data. – Matty Jun 21 '17 at 11:26
  • I've just had the same issue with VS Professional 16.3.5 and following the instructions in the Error message "No exports were found that match the constraint contract name" link worked for me – Steve Mansfield Oct 17 '19 at 07:52
19

Solution for Visual Studio 2017:

Step 1: open Visual Studio cmd in administrator mode (see start menu item: Developer Command Prompt for VS 2017 - Be sure to use: Run as administrator)

Step 2: change directory to the folder where Visual Studio 2017 is installed, for example:

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

(You can copy/paste this command to your cmd prompt. For Visual Studio Professional, the folder will be called "Professional" instead of "Enterprise", etc.)

Step 3: copy/paste the below command

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

Hit Enter...

It will resolve the issue...

Otherwise, you can also add the following to the GAC as above:

Microsoft.VisualStudio.Shell.Interop.9.0.dll

Microsoft.VisualStudio.Shell.Interop.10.0.dll

Microsoft.VisualStudio.Shell.Interop.11.0.dll

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
dinesh kumar
  • 191
  • 1
  • 4
  • 1
    I have had several Visual Studio projects show this error, and each time I repeated the steps above to solve it. – qxotk Aug 23 '18 at 21:33
  • This solved my problem. We just upgraded our source from 2015 with 4.6.2 to 2017 with 4.7.1. I just started getting this problem and this is the solution that worked for me. Thanks for the fix! – Osiris Sep 06 '18 at 17:00
  • This is the only thing that worked for me after trying everything else above. Thanks! – Martin Sep 17 '19 at 15:29
  • 3
    In 2019 you need to add `Microsoft.VisualStudio.Shell.Interop.12.0.dll` – HackSlash Feb 07 '20 at 20:35
  • I tried 15+ solutions. Only this answer has some magic. – Gray Programmerz Apr 12 '21 at 15:57
  • suddenly one of my solutions started to show "HtmlPackage" did not load correctly, and another similar solution did not.. adding to GAC solved it.. BUT WHY? *added: Microsoft.VisualStudio.Shell.15.0* – Boppity Bop Jul 29 '21 at 10:15
  • Did not work for me. Tried adding all the listed dlls plus the ones listed in the comments here. – alelom Mar 23 '23 at 08:30
16

I had a similar problem, and I went to Control PanelPrograms and repaired the Visual Studio installation. It worked for me.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Daniel
  • 181
  • 1
  • 4
  • 2
    Tried 2 of above solutions for the same error but for **SpecFlow** package, it did not work. **This worked for me**. The solutions I tried: 1: Removing [ComponentModelCache](https://stackoverflow.com/a/23646013/1265945) 2: Removing [AppData\Roaming\Microsoft\VisualStudio\11.0](https://stackoverflow.com/a/18800520/1265945) – Brampage Mar 06 '18 at 08:58
  • 2
    You can't repair Visual Studio 2017 from Control Panel, you have to navigate to `C:\Program Files (x86)\Microsoft Visual Studio\Installer` where you can find the `vs_installer.exe` file. – Brampage Mar 06 '18 at 09:00
4

I had the same problem. Try to remember the latest extension that you installed. I delete the latest extension from extensions and updates and restart Visual Studio. and the problem is solved. For me, the extension name is Productivity Power Tools

Elvin Mammadov
  • 25,329
  • 11
  • 40
  • 82
3

I had a similar issue (Tizen Project type package did not load correctly) with Visual Studio 2017.

After trying all the answers above, and spending a few hours searching for a solution for the errors inside ActivityLog.XML, nothing worked for me.

Eventually, the solution was a Visual Studio Repair.

I assume that the repair process overrides some configurations that caused the problem.

Repair Visual Studio 2017
Repair Visual Studio 2019

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Jonathan Applebaum
  • 5,738
  • 4
  • 33
  • 52
  • This worked for me with VS 2019. I ran the repair process, rebooted, and the error went away. – daGUY Jan 21 '22 at 18:16
2

I also experienced this issue after installing Telerik Reporting. I was not able to launch any solution in Visual Studio 2013, nor could I close Visual Studio 2013.

After uninstalling the reporting package and deleting Local / Roaming AppData for Visual Studio 2012, the problem was fixed.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
alan
  • 6,705
  • 9
  • 40
  • 70
  • 1
    Got a heap of similar errors recently. I was evaluating DevExpress components during last three weeks. So I uninstalled DevExpress, the error messages are gone. Not sure if DevExpress caused the problem though – Alex Klaus Feb 26 '14 at 00:14
  • 1
    In my case I reinstalled devexpress and all worked ok after that – rasputino Nov 17 '14 at 14:18
2

In my case the error message is "The 'IntelliCodeCppPackage' package did not load correctly" (Visual Studio 2019):

IntelliCodeCppPackage

I solved this is issue with these steps;

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
boyukbas
  • 1,137
  • 16
  • 24
2

I tried everything except the repair. I even did an update. This is what fixed it for me:

  1. Open "Developer Command Prompt for VS 2017" as Admin
  2. CD into (your path may vary) CD C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\PublicAssemblies
  3. Run command gacutil -i Microsoft.VisualStudio.Shell.Interop.11.0.dll
  4. Restart Visual Studio
Jeff
  • 155
  • 1
  • 10
  • A much better version of this answer was already posted 2 years before this: https://stackoverflow.com/a/51588427/3873799. Please do not add noise with redundant answers. This issue is already messy as it is. – alelom Mar 23 '23 at 08:34
1

You need to find file devenv.exe.config in C:\Users\{user_name}\AppData\Local\Microsoft\VisualStudio\14.0\ and update it. (Or C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\, depending on the location of your devenv.exe file.)

For this particular case, you should find rows that setup redirects for System.Collections.Immutable and change newVersion from 1.1.36.0 to 1.1.37.0.

The original article is How to restore Visual Studio 2015 after the Update 1 (dependency dance).

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
1

Based on this Connect feedback I fixed it by closing all opened documents and restarting Visual Studio. I use Visual Studio 2015.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Jan Zahradník
  • 2,417
  • 2
  • 33
  • 44
1

I also experienced the same error, "NPM package not installed correctly", while creating a Node.js project in Visual Studio 2015.

I resolved my issue by performing two steps:

  1. Delete all files present in this location:

    C:\Users\<Your User Name>\AppData\Local\Microsoft\VisualStudio\14.0\ComponentModelCache
    

    Restart Visual Studio.

  2. Open Visual Studio and go to menu ToolsNuGet Package ManagerPackage Manager Settings

    On the left side: You will see a drop down list: select Node.js, ToolsNpmClearCache → *OK

Then again try to create the project. It resolved my issue.

qxotk
  • 2,384
  • 5
  • 24
  • 39
1

I had this problem, and projects were not loading correctly or stating that they needed migration. The ActivityLog.xml showed an error with a particular extension. I uninstalled the extension and restarted Visual Studio. That resolved the issue.

Owen Pauling
  • 11,349
  • 20
  • 53
  • 64
1

I had the pleasure of experiencing this random problem in Visual Studio 2017 Enterprise.

I tried every solution here, and it didn't work, including the Visual Studio repair (which takes a while). Several hours in, I thought maybe I should actually check the ActivityLog.xml file.

ActivityLog.xml

I uninstalled the offending extension from the 'Developer Command Prompt for VS2017' as an administrator since Visual Studio just freezed after open and nothing could be clicked.

Steps to uninstall - courtesy of jessehouwing.net

  1. Find the vsix file you used to install the extension.
  2. Open it in your favorite archiver (mine is 7-Zip).
  3. Grab the extension's Id from the Identity node from the extension.vsixmanifest.
  4. Run (in my case) vsixinstaller /u:Microsoft.VisualStudio.LiveShare to remove the extension.
Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Nhan
  • 1,405
  • 1
  • 13
  • 16
1
  1. Find the ComponentModelCache folder
  2. Delete Microsoft.VisualStudio.Default.cache
  3. Restart Visual Studio

Enjoy using Visual Studio.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
1

I had a similar problem.

After checking ActivityLog.xml and it said that it could not create an instance for the Extension/package name from a specific folder. I traced that path and I didn't find that folder it is looking for.

So I installed the extension again, I looked for the dll, and copied the containing folder contents to the folder Visual Studio is looking for.

So to recap:

  1. Check if the folder in the error exists
  2. If not, create a new folder with the same name
  3. Look for the dll in the error in the Visual Studio folder, if not found, install the extension again
  4. If the error resists, search inside the Visual Studio folder in Program Files (x86) for the dll and open the containing folder
  5. Copy all the contents
  6. Paste inside the new folder you have created with the name mentioned inside the ActivityLog.xml
stealthyninja
  • 10,343
  • 11
  • 51
  • 59
Peter Sameh
  • 23
  • 1
  • 7
1

Firstable, you need to be sure have the last Microsoft .NET Framework version, in my case, I had the 4.6 version and I have downloaded and updated the .NET Framework 4.8.03761 Developer Pack, from the official site:

https://dotnet.microsoft.com/download/dotnet-framework/net48

Once I restarted my PC, to continue fixing that, I solved this problem by clearing Visual Studio Component Model Cache.

Just delete or rename this folder:

%LocalAppData%\Microsoft\VisualStudio\11.0\ComponentModelCache or

%LocalAppData%\Microsoft\VPDExpress\11.0\ComponentModelCache and restart Visual Studio.

Sam San
  • 36
  • 5
1

Since this is the top SO result in google for this issue, I'm going to leave my fix here for VS 2022 when experiencing this issue. I found it is commonly caused by an extension issue. In my particular case TypeScript Definition Generator was causing the issue and removing the extension solved it. To find which extension could be causing the issue, run VS with the /Log command line switch.

i.e.: "C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\devenv.exe" /Log

After the error occurs, close VS and locate ActivityLog.xml found at %AppData%\Microsoft\VisualStudio\<version>\ActivityLog.xml. Search the log for any extensions reporting an error and uninstall it.

Seth
  • 972
  • 1
  • 7
  • 18
0

I had this problem after installing Crystal Reports for Visual Studio. I solved it by closing all Visual Studio instances and reinstalling Crystal Reports.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
egse
  • 170
  • 2
  • 9
0

I just wanted to mention that I got a similar error in SQL Server Management Studio 2016, where I basically ignored it. Later, I launched Visual Studio (2015), and this error occurred there as well.

I searched and found the answer here recommending that files be deleted from the

%localappdata%\Microsoft\VisualStudio\14.0\ComponentModelCache

folder. However, in my case, this folder was empty.

Since I remembered that I saw the error in Management Studio first, I checked, and there was a similar folder at

%localappdata%\Microsoft\SQL Server Management Studio\13.0\ComponentModelCache

This folder was not empty. I closed both Visual Studio and Management Studio, and deleted the files from this folder.

Afterwards, both Management Studio and Visual Studio launched without error.

0

I solved it:

  1. Go to install
  2. Modify
  3. Go to "Installation location" tab
  4. Check "keep download cache after the installation"
  5. Modify
Adrian Mole
  • 49,934
  • 160
  • 51
  • 83
0

My issue was Mysql connector net 6.4.4, Nuget, xamarin, VSPackage, EditorPackage and etc.. package did not load correctly.

My solution is below for vs2015

  1. Open AppData location // all the configurations are updating on it.
  2. Backup and Remove the folder in which configuration error is thrown in the visual studio.

forex. If you have Nuget package did not load correctly error - Remove Nuget folder in Local and Roaming directories.

  1. And also clear the data on AppData/Microsoft/visual Studio/14.0 for vs2015

that's it and it worked for me!...

0

For Visual Studio 2019: I have done the following things to solve the problem

Backup the following Folder. After Taking backup and Delete This Folder C:\Users\munirul2537\AppData\Roaming\Microsoft\VisualStudio\16.0_add0ca51

Go to the installation panel of visual studio and do the following things

1.Go to install 2.Modify 3.Go to "Installation location" tab 4. Check "keep download cache after the installation" 5. Modify

Munirul Islam
  • 191
  • 1
  • 4
0

For Visual Studio 2017, 2019. I got this error and able to fix it just by enable the Live Share extension from extensions.

see the VS community page for detail.

Tahir Alvi
  • 896
  • 2
  • 14
  • 44
0

For others that have a similar problem but with live share.

In the visual studio installer there was a warning that live share was not installed correctly and a modification was pending, that would download live share again.

After completion of the modification the error was resolved.

Athanviel
  • 199
  • 1
  • 3
  • 15
0

I had the same problem for Visual Studio 2019 v16.8.6. It was fixed after repair Visual Studio from Visual Studio Installer.

Tolga Cakir
  • 725
  • 1
  • 7
  • 13
0

One more solution that worked for my colleague after trying all the others that did not work (for Visual Studio 2022).

Try this:

  1. Close all instances of Visual Studio
  2. Go to: C:\Program Files (x86)\Microsoft SDKs\Windows
  3. You should see a number of vX.0-like directories (e.g. v10.0A for Visual Studio 2022 Enterprise). Back-up and remove all those directories except the one matching your Visual Studio (in my case I'd remove everything except v10.0A).
  4. Start Visual Studio. The "package did not load correctly" warning will be gone.

Rationale: If you had older versions of Visual Studio installed previously, they will come with their own NETFX Tools which might not uninstall correctly together with those older instances of Visual Studio. The new Visual Studio will for some reason pick the old Tools and fail using them. Removing the redundant directories fixes it.

Astralius
  • 18
  • 4
0

I met this problem. This is how I resolved it:

  1. Firstly, I deleted AppData\Local\Microsoft\VisualStudio\17.0_d1adb3fb/ComponentModelCache, and launch Visual Studio 2022, and other window popup.
  2. Secondly, I deleted the ComponentModelCache again. No error occurred, but the extension is empty.
  3. Finally, I upgraded VS 2022 to 17.2.5, the problem was solved.
Lee Taylor
  • 7,761
  • 16
  • 33
  • 49
0

None of these solutions here worked for me. After a fresh installation of Visual Studio 2022, when opened from Start Menu it opened without any errors. However when launched from command prompt, I got 2 'package did not load correctly' errors (IntelliCodeCppPackage, Global Hub Client Package) and IDE closed automatically. Turns out the root cause in my case was using shortened file path in cmd.

I had it like this:

set MS_DEV=C:\PROGRA~1\MIB055~1\2022\Preview
call %MS_DEV%\VC\Auxiliary\Build\vcvars64.bat
call %MS_DEV%\Common7\IDE\devenv.exe

Changing shortened path will full path loaded the packages correctly for me

set MS_DEV="C:\Program Files\Microsoft Visual Studio\2022\Preview"

Shortened path used to work with Visual Studio 2017, not sure what changed in 2022.

Surya
  • 45
  • 7
0

For VS2022 after it got updated to 17.6 I started receveing The 'whatever-name' package did not load correctly.

  • What worked for me: rebooting my computer
  • What didn't work: most upvoted answers for the question
amartin1911
  • 512
  • 5
  • 11
0

I read this entire article around 15 times, without success. What worked for me was the following (VS 2022, Release 17.6):

  1. Close the VS application

  2. Go to "Common7\IDE\Extensions\Microsoft\CodeSense\Framework"

  3. Run "gacutil -if" to all DLLs there:

    gacutil -if Microsoft.VisualStudio.CodeSense.Common.dll

    gacutil -if Microsoft.VisualStudio.CodeSense.dll

    gacutil -if Microsoft.VisualStudio.CodeSense.Roslyn.dll

0

Open Visual Studio with Run as Administrator

  • The issue is due to lack of permission
-1

After trying lots of options this worked for me (VS 2019):

  1. Launch Developer Command Prompt for VS 2019 (Run as Administrator)
  2. cd "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\PublicAssemblies" Replace Community with your specific distribution.
  3. Execute the next line: gacutil -i Microsoft.VisualStudio.Shell.Interop.11.0.dll
SDEscobedo
  • 385
  • 1
  • 2
  • 11