-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Description
Prerequisites
- Write a descriptive title.
- Make sure you are able to repro it on the latest released version
- Search the existing issues.
- Refer to the FAQ.
- Refer to Differences between Windows PowerShell 5.1 and PowerShell.
Steps to reproduce
Update: The problem is specific to Windows ARM64 builds, irrespective of installation method - see below
Whether the WinForms and WPF assemblies ship with PowerShell Core depends on the installation method:
YES:MSI package[the only reason this worked is because I accidentally installed the x64 version, not the ARM64 one]
NO:winget install Microsoft.PowerShell(Microsoft Store)Installation via https://aka.ms/install-powershell.ps1
Thus, WinForms code breaks with the latter two installation methods with ARM64 builds, because~~ Add-Type -AssemblyName System.Windows.Forms fails due to the absence of the relevant assemblies.
- Note: The .NET Framework version in the GAC is not found, though loading it explicitly with
Add-Type -LiteralPath C:\Windows\Microsoft.NET\Framework64\v4.0.30319\System.Windows.Forms.dlldoes seem to work in practice.
Verify the presence / absence with:
Get-Item $PSHOME/System.Windows.Forms.dllIs this a known / by-design? If so, it should at least be documented, with a detailed list of what's absent when not using the MSI installer.
Note that there's also technically distinct, but related problem (which also happens if the WinForms assemblies are present): the ability to load the WinForms assembly via using assembly System.Windows.Forms has been broken since using before v7..0:
Expected behavior
The file should be present.
Actual behavior
The file is present only if PowerShell was installed via the MSI installer
Error details
No response
Environment data
PowerShell Core v7.3.1 (.NET 7.0.0)
PowerShell Core v7.4.0-preview.1 (.NET 7.0.1)
on Microsoft Windows 11 Pro (ARM 64-bit Processor; Version 22H2, OS Build: 22621.963)Visuals
No response