4

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.

Henry Twist
  • 5,666
  • 3
  • 19
  • 44
  • 1
    So if the installer also fails sometimes, did you try to [fix the VS Installer](https://learn.microsoft.com/en-us/visualstudio/install/troubleshooting-installation-issues?view=vs-2019#step-4---delete-the-visual-studio-installer-folder-to-fix-upgrade-problems) itself? I would uninstall VS (+the installer) completeley, remove the mentioned folders from AppData, create another offline account with admin privilege and install there. Then try to run under the original account. – Martin Schneider Oct 09 '21 at 19:01
  • I have already been through the steps you've linked unfortunately @MartinSchneider. However I haven't tried to reinstall it on another account, I'll try that if you think it could make a difference! – Henry Twist Oct 09 '21 at 23:26
  • 1
    The following may be helpful: https://learn.microsoft.com/en-us/visualstudio/install/uninstall-visual-studio?view=vs-2019 – Tu deschizi eu inchid Oct 10 '21 at 21:07
  • @user9938 Unfortunately I've already tried uninstalling multiple times, including with the `InstallCleanup` tool. I've also manually deleted cache, temporary files, roaming and local data and registry keys but no luck. – Henry Twist Oct 11 '21 at 06:18
  • 1
    "Visual Studio Common IDE Package" and others not working basically means *nothing* works. The fact it works when as admin is probably very meaningful, it seems like a security problem. Ideas: are you running with UAC disabled? Do you have specific enterprise policy running? Anti-virus? 3rd party related to security? – Simon Mourier Oct 11 '21 at 10:32
  • 1
    As someone else already stated, since you don't have any issues when run as Administrator, it may be a security (file/folder) permissions issue. You may want to check your permissions for `%ProgramData%\Microsoft\VisualStudio` (and sub-folders) and `%ProgramFiles(x86)%\Microsoft Visual Studio` (and sub-folders). Since, installing/re-installing takes quite a bit of time, you may actually save yourself time by re-imaging your computer (ie: re-installing Windows). – Tu deschizi eu inchid Oct 11 '21 at 11:03
  • 1
    The following may or may not be useful: https://learn.microsoft.com/en-us/windows-hardware/manufacture/desktop/repair-a-windows-image and/or https://learn.microsoft.com/en-us/troubleshoot/windows-server/deployment/fix-windows-update-errors . – Tu deschizi eu inchid Oct 11 '21 at 11:04
  • 1
    Are you using the newest version of Windows 10? I guess that there is a problem with your system itself. Setting up Windows completely new would solve the problem I guess, you could try it out by installing a Windows Virtual Machine and install Visual Studio 2019 there. – AztecCodes Oct 14 '21 at 08:26
  • Unfortunately I couldn't find any security related issues, everything seemed fine. So I did eventually end up reinstalling Windows which solved the problem. What a mystery. – Henry Twist Oct 18 '21 at 20:49

2 Answers2

0

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.

Surya
  • 45
  • 7
  • Did you double-check whether the short path actually exists on the current machine? – Stefan Wuebbe Aug 01 '22 at 09:40
  • Yes, the short path exists on the machine where I have this script. With the short path in MS_DEV var, devenv.exe launches, but with the errors. With long path, no errors. – Surya Aug 01 '22 at 23:44
-1

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

Henry Twist
  • 5,666
  • 3
  • 19
  • 44
  • When performing a VS upgrade, do you select "Download first, then install" or "Install while downloading"? Did you cancel and restart the upgrade? – Tu deschizi eu inchid Oct 18 '21 at 22:56
  • I actually only tried *install while downloading*, it would have been interesting to have tried the other option, definitely something to try if it occurs again. I didn't cancel and restart the upgrade at any point. – Henry Twist Oct 18 '21 at 23:01
  • 1
    I had once had an issue when I selected "Install while downloading" and the process was interrupted. Un-installing/re-installing didn't fix the issue. After re-installing VS twice, and VS having errors, I re-installed Windows. I now always choose "Download, then install". – Tu deschizi eu inchid Oct 18 '21 at 23:37