Open JanDeDobbeleer opened 9 months ago
Hi I'm an AI powered bot that finds similar issues based off the issue title.
Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!
Note: You can give me feedback by thumbs upping or thumbs downing this comment.
@JanDeDobbeleer I'm asking the engineering team to take a look. I wasn't able to reproduce the error.
It would help to know which module version you have and the directory structure of the module, that dl must be under net6.0-windows10.0.22000\DirectDependencies.
This is run with --verbose
2024-02-20 20:25:22.190 [CORE] WinGet, version [1.7.3481-preview], activity [{B42988C8-340C-4810-BAFB-6AC7BEFE0FB3}]
2024-02-20 20:25:22.190 [CORE] OS: Windows.Desktop v10.0.22000.2538
2024-02-20 20:25:22.190 [CORE] Command line Args: "C:\Users\jan\AppData\Local\Microsoft\WindowsApps\winget.exe" configure C:\Users\jan\AppData\Local\Packages\Microsoft.WindowsTerminalPreview_8wekyb3d8bbwe\LocalState\oh-my-posh.configuration.yml --logs --verbose
2024-02-20 20:25:22.190 [CORE] Package: Microsoft.DesktopAppInstaller v1.22.3481.0
2024-02-20 20:25:22.190 [CORE] IsCOMCall:0; Caller: winget-cli
2024-02-20 20:25:22.196 [CLI ] WinGet invoked with arguments: 'configure' 'C:\Users\jan\AppData\Local\Packages\Microsoft.WindowsTerminalPreview_8wekyb3d8bbwe\LocalState\oh-my-posh.configuration.yml' '--logs' '--verbose'
2024-02-20 20:25:22.196 [CLI ] Found subcommand: configure
2024-02-20 20:25:22.197 [CLI ] Leaf command to execute: root:configure
2024-02-20 20:25:22.197 [CLI ] Executing command: configure
2024-02-20 20:25:22.214 [CONF] Launching process for configuration processing...
2024-02-20 20:25:22.220 [CONF] Configuration remote PID is 10084
2024-02-20 20:25:22.447 [CONF] ... configuration processing connection established.
2024-02-20 20:25:22.449 [CONF] Applying built in additional module path: C:\Program Files\WindowsApps\Microsoft.DesktopAppInstaller_1.22.3481.0_arm64__8wekyb3d8bbwe\ExternalModules
2024-02-20 20:25:22.679 [CONF] [CONF] Parsing configuration set:
2024-02-20 20:25:22.679 [CONF] # yaml-language-server: $schema=https://aka.ms/configuration-dsc-schema/0.2
properties:
resources:
- resource: Microsoft.WinGet.DSC/WinGetPackage
id: ohmyposh
directives:
description: Install Oh My Posh
allowPrerelease: true
settings:
id: JanDeDobbeleer.OhMyPosh
source: winget
configurationVersion: 0.2.0
2024-02-20 20:25:22.679 [CONF] [YAML] Detected UTF-8
2024-02-20 20:25:22.961 [CONF] Creating set processor for `oh-my-posh.configuration.yml`...
2024-02-20 20:25:24.025 [CONF] Using winget module path
2024-02-20 20:25:24.025 [CONF] Effective module path:
C:\Users\jan\AppData\Local\Microsoft\WinGet\Configuration\Modules;C:\Program Files\WindowsApps\Microsoft.DesktopAppInstaller_1.22.3481.0_arm64__8wekyb3d8bbwe\ExternalModules;C:\Users\jan\Documents\PowerShell\Modules;C:\Program Files\PowerShell\Modules;c:\program files\windowsapps\microsoft.desktopappinstaller_1.22.3481.0_arm64__8wekyb3d8bbwe\configurationremotingserver\Modules;c:\program files (arm)\powershell\Modules;C:\Program Files\WindowsPowerShell\Modules;C:\Windows\system32\WindowsPowerShell\v1.0\Modules
2024-02-20 20:25:26.858 [CONF] PowerShellCommands: ['Import-Module' Parameters: FullyQualifiedName = '@{ ModuleName = 'PSDesiredStateConfiguration'; ModuleVersion = '2.0.7'; MaximumVersion = '2.999999999' }' ]
2024-02-20 20:25:26.858 [CONF] ... done creating set processor.
2024-02-20 20:25:26.880 [CONF] Getting unit details [ReadOnly] for: Microsoft.WinGet.DSC/WinGetPackage
2024-02-20 20:25:30.804 [CONF] Creating set processor for `oh-my-posh.configuration.yml`...
2024-02-20 20:25:30.861 [CONF] Using winget module path
2024-02-20 20:25:30.861 [CONF] Effective module path:
C:\Users\jan\AppData\Local\Microsoft\WinGet\Configuration\Modules;C:\Program Files\WindowsApps\Microsoft.DesktopAppInstaller_1.22.3481.0_arm64__8wekyb3d8bbwe\ExternalModules;C:\Users\jan\Documents\PowerShell\Modules;C:\Program Files\PowerShell\Modules;c:\program files\windowsapps\microsoft.desktopappinstaller_1.22.3481.0_arm64__8wekyb3d8bbwe\configurationremotingserver\Modules;c:\program files (arm)\powershell\Modules;C:\Program Files\WindowsPowerShell\Modules;C:\Windows\system32\WindowsPowerShell\v1.0\Modules
2024-02-20 20:25:31.040 [CONF] ... done creating set processor.
2024-02-20 20:25:31.043 [CONF] Creating unit processor for: Microsoft.WinGet.DSC/WinGetPackage...
2024-02-20 20:25:31.359 [CONF] ... done creating unit processor.
2024-02-20 20:25:31.359 [CONF] Using unit from location: C:\Users\jan\AppData\Local\Microsoft\WinGet\Configuration\Modules\Microsoft.WinGet.DSC\0.2.0\Microsoft.WinGet.DSC.psd1
2024-02-20 20:25:31.362 [CONF] Invoking `Test` for resource: Microsoft.WinGet.DSC/WinGetPackage...
2024-02-20 20:25:31.654 [CONF] Microsoft.Management.Configuration.Processor.Exceptions.InvokeDscResourceException: Failed when calling `Test` for resource: WinGetPackage [Microsoft.WinGet.DSC] Message: 'Could not load file or assembly 'Microsoft.WinGet.Client.Engine, Version=1.21.0.0, Culture=neutral, PublicKeyToken=null'. Uncaught exception during type initialization. (0x80131534)
'
at Microsoft.Management.Configuration.Processor.DscModule.DscModuleV2.InvokeTestResource(PowerShell pwsh, ValueSet settings, String name, ModuleSpecification moduleSpecification)
at Microsoft.Management.Configuration.Processor.Runspaces.HostedEnvironment.InvokeTestResource(ValueSet settings, String name, ModuleSpecification moduleSpecification)
at Microsoft.Management.Configuration.Processor.Unit.ConfigurationUnitProcessor.TestSettings()
2024-02-20 20:25:31.654 [CONF] ... done invoking `Test`.
2024-02-20 20:25:31.678 [CONF] Configuration unit WinGetPackage[ohmyposh] failed with code 0x8a15c105 and error message:
Could not load file or assembly 'Microsoft.WinGet.Client.Engine, Version=1.21.0.0, Culture=neutral, PublicKeyToken=null'. Uncaught exception during type initialization. (0x80131534)
Microsoft.Management.Configuration.Processor.Exceptions.InvokeDscResourceException: Failed when calling `Test` for resource: WinGetPackage [Microsoft.WinGet.DSC] Message: 'Could not load file or assembly 'Microsoft.WinGet.Client.Engine, Version=1.21.0.0, Culture=neutral, PublicKeyToken=null'. Uncaught exception during type initialization. (0x80131534)
'
at Microsoft.Management.Configuration.Processor.DscModule.DscModuleV2.InvokeTestResource(PowerShell pwsh, ValueSet settings, String name, ModuleSpecification moduleSpecification)
at Microsoft.Management.Configuration.Processor.Runspaces.HostedEnvironment.InvokeTestResource(ValueSet settings, String name, ModuleSpecification moduleSpecification)
at Microsoft.Management.Configuration.Processor.Unit.ConfigurationUnitProcessor.TestSettings()
2024-02-20 20:25:31.679 [CLI ] Terminating context: 0x8a15c005 at C:\__w\1\s\external\pkg\src\AppInstallerCLICore\Workflows\ConfigurationFlow.cpp:3f9
@denelon I had a look at the module paths and here are the versions which are present:
C:\Users\jan\AppData\Local\Microsoft\WinGet\Configuration\Modules
- 1.21.2311.09003
C:\Program Files\WindowsApps\Microsoft.DesktopAppInstaller_1.22.3481.0_arm64__8wekyb3d8bbwe\ExternalModules
- N/A
C:\Users\jan\Documents\PowerShell\Modules
- 1.21.2311.09003
C:\Program Files\PowerShell\Modules
- N/A
c:\program files\windowsapps\microsoft.desktopappinstaller_1.22.3481.0_arm64__8wekyb3d8bbwe\configurationremotingserver\Modules
- N/A
c:\program files (arm)\powershell\Modules
- N/A
C:\Program Files\WindowsPowerShell\Modules
- N/A
C:\Windows\system32\WindowsPowerShell\v1.0\Modules
- N/A
1.21.2311.09003 is for the 1.6.3133.0 module version. I'm guessing if you run get-module microsoft.winget.client -ListAvailable
in a pwsh session you will see two results (you need to add the local app data path to the psmodulepath tho)
Can you try loading the client module directly in pwsh from both locations? It might be easier to load the psd1 directly.
@msftrubengu to be honest, I just want to be able to run winget configure
and not deal with DLL hell. From a user POV, this should simply work:
winget configure
Brief description of your issue
I'm trying to run a working configuration (provided by @denelon here) but it fails on my machine using the same configuration.
Steps to reproduce
Not sure, it seems to be device/environment specific.
Expected behavior
It succeeds in applying the configuration.
Actual behavior
It crashed with:
Environment