The X package did not load correctly when starting Visual Studio 2019

Viewed 1426

When I start Visual Studio 2019 I am encountering a number of errors stating that a package did not load correctly. They vary, but they're all of the same format:

The '[Some package]' 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\henry\AppData\Roaming\Microsoft\VisualStudio\16. 0_d0c288a2\ActivityLog.xml'.

Restarting Visual Studio could help resolve this issue.

with the packages being:

  • Global Hub Client Package
  • Settings Package
  • Visual Studio Common IDE Package
  • Extension Manager Package
  • Environment Package Window Management

Then finally it shows:

A problem occurred when loading the Microsoft Visual Studio menu. To fix this problem, run 'devenv.exe /resetsettings from the command prompt. Note: this command resets your environment settings.


I have tried all the solutions I have found online, including reinstalling Visual Studio (and the installer itself, with and without any workloads) and the installer completely, with deleting all local and roaming app data folders and even the VS registry keys.

A common solution seems to be to delete ComponentModelCache which I have also tried.

I have also run all devenv commands that seem relevant.

Finally I've attempted repairs from the installer. When I do try and repair/reinstall from the installer, sometimes it fails completely with a Sorry, something went wrong mesage.


Strangely enough, everything works fine when I run Visual Studio as an administrator, but I shouldn't have to do this every time.

2 Answers

This eventually got solved by reinstalling Windows (keeping apps and files etc.) which has solved the problem for now, hopefully it doesn't recur.

For 2022. 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.

Related