choco
choco copied to clipboard
'[ERROR] - Unable to load one or more of the requested types.' on calling choco after fresh install
Checklist
- [X] I have verified this is the correct repository for opening this issue.
- [X] I have verified no other issues exist related to my problem.
- [X] I have verified this is not an issue for a specific package.
- [X] I have verified this issue is not security related.
- [X] I confirm I am using official, and not unofficial, or modified, Chocolatey products.
What You Are Seeing?
PowerShell 7.3.6
PS C:\Users\jbdud> choco --version
Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
What is Expected?
The installed choco version number.
How Did You Get This To Happen?
- Opened a PS 7.3.6 shell in Microsoft Terminal running as Administrator
- Copied the Powershell command presented on https://chocolatey.org/install
- The install completed without error
- Restarted Microsoft Terminal
- Enter any choco command
System Details
- Operating System: 10.0.19045.0
- Windows PowerShell version: 7.3.6
- Chocolatey CLI Version:
choco --version
returns error above. Given new install, presumably 2.2.0. - Chocolatey Licensed Extension version: unknown
- Chocolatey License type: no license/free license
- Terminal/Emulator: Microsoft Terminal
Installed Packages
N/A
Output Log
2023-07-31 21:49:15,076 13924 [DEBUG] - XmlConfiguration is now operational
2023-07-31 21:49:15,114 13924 [DEBUG] - Adding new type 'CygwinService' for type 'IAlternativeSourceRunner' from assembly 'choco'
2023-07-31 21:49:15,115 13924 [DEBUG] - Adding new type 'CygwinService' for type 'IInstallSourceRunner' from assembly 'choco'
2023-07-31 21:49:15,116 13924 [DEBUG] - Adding new type 'PythonService' for type 'IAlternativeSourceRunner' from assembly 'choco'
2023-07-31 21:49:15,116 13924 [DEBUG] - Adding new type 'PythonService' for type 'IListSourceRunner' from assembly 'choco'
2023-07-31 21:49:15,117 13924 [DEBUG] - Adding new type 'PythonService' for type 'IInstallSourceRunner' from assembly 'choco'
2023-07-31 21:49:15,117 13924 [DEBUG] - Adding new type 'PythonService' for type 'IUninstallSourceRunner' from assembly 'choco'
2023-07-31 21:49:15,118 13924 [DEBUG] - Adding new type 'RubyGemsService' for type 'IAlternativeSourceRunner' from assembly 'choco'
2023-07-31 21:49:15,118 13924 [DEBUG] - Adding new type 'RubyGemsService' for type 'IListSourceRunner' from assembly 'choco'
2023-07-31 21:49:15,119 13924 [DEBUG] - Adding new type 'RubyGemsService' for type 'IInstallSourceRunner' from assembly 'choco'
2023-07-31 21:49:15,119 13924 [DEBUG] - Adding new type 'SystemStateValidation' for type 'IValidation' from assembly 'choco'
2023-07-31 21:49:15,120 13924 [DEBUG] - Adding new type 'CacheFolderLockdownValidation' for type 'IValidation' from assembly 'choco'
2023-07-31 21:49:15,439 13924 [ERROR] - Chocolatey had an error occur:
System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)
at System.Reflection.Assembly.GetTypes()
at chocolatey.infrastructure.app.registration.ChocolateyRegistrationModule.RegisterDependencies(IContainerRegistrator registrator, ChocolateyConfiguration configuration)
at chocolatey.infrastructure.app.registration.ContainerBinding.RegisterComponents(Container container)
at chocolatey.infrastructure.registration.SimpleInjectorContainer.Initialize()
at System.Lazy`1.CreateValue()
at System.Lazy`1.LazyInitValue()
at chocolatey.console.Program.Main(String[] args)
2023-07-31 21:49:15,441 13924 [DEBUG] - Exiting with 1
Additional Context
.NET versions, updates etc listed here: https://gist.github.com/Bzly/d8cfbd379e215566d40ba595978fa2b0
Possibly linked to #3228
I am also running into this error when trying to run choco on my windows 10 vm -- any updates?