Skip to content

Can't run PowerShell on Ubuntu 20.04 arm64 due to a problem with the 'Microsoft.ApplicationInsights' assembly #19055

@damonbarry

Description

@damonbarry

Prerequisites

Steps to reproduce

On a fresh Ubuntu 20.04 arm64 VM, I installed the .NET 6.0 SDK (version 6.0.405). Then I took the following steps:

curl -sSL 'https://pwshtool.blob.core.windows.net/tool/7.2.9/PowerShell.Linux.arm64.7.2.9.nupkg' -o 'PowerShell.Linux.arm64.7.2.9.nupkg'
sudo mkdir -p /usr/share/powershell
sudo dotnet tool install --add-source . --tool-path /usr/share/powershell --version '7.2.9' PowerShell.Linux.arm64
sudo dotnet nuget locals all --clear
sudo ln -s /usr/share/powershell/pwsh /usr/bin/pwsh
sudo chmod 755 /usr/share/powershell/pwsh
pwsh

Expected behavior

`pwsh` should open a PowerShell session. And, in fact, it works as expected with previous versions, e.g., https://pwshtool.blob.core.windows.net/tool/7.2.8/PowerShell.Linux.arm64.7.2.8.nupkg.

Actual behavior

azureuser@my-arm-vm:~$ pwsh
PowerShell 7.2.9
Copyright (c) Microsoft Corporation.

https://aka.ms/powershell
Type 'help' to get help.

Process terminated. Could not load file or assembly 'Microsoft.ApplicationInsights, Version=2.21.0.429, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. An attempt was made to load a program with an incorrect format.

   at System.Environment.FailFast(System.String, System.Exception)
   at Microsoft.PowerShell.UnmanagedPSEntry.Start(System.String[], Int32)
   at Microsoft.PowerShell.ManagedPSEntry.Main(System.String[])
System.BadImageFormatException: Could not load file or assembly 'Microsoft.ApplicationInsights, Version=2.21.0.429, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. An attempt was made to load a program with an incorrect format.

File name: 'Microsoft.ApplicationInsights, Version=2.21.0.429, Culture=neutral, PublicKeyToken=31bf3856ad364e35'
   at Microsoft.PowerShell.Telemetry.ApplicationInsightsTelemetry.SendPSCoreStartupTelemetry(String mode)
   at Microsoft.PowerShell.ConsoleHost.Start(String bannerText, String helpText)
   at Microsoft.PowerShell.UnmanagedPSEntry.Start(String[] args, Int32 argc)Aborted (core dumped)

Error details

N/A

Environment data

N/A

Visuals

No response

Metadata

Metadata

Assignees

Labels

Issue-BugIssue has been identified as a bug in the productNeeds-InvestigationThe behavior reported in the issue is unexpected and needs further investigation.Resolution-FixedThe issue is fixed.WG-Enginecore PowerShell engine, interpreter, and runtime

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions