question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`dotnet tool install -a arm64` fails on linux-arm64

See original GitHub issue

Describe the bug

dotnet tool install --global <tool-name> --arch arm64 fails reporting that the RID linux-arm64 is invalid.

To Reproduce

  1. Create Amazon Linux 2 ARM 64 Instance
  2. Install dotnet 6
  3. run dotnet tool install --global dotnet-sonarscanner --arch arm64

Exceptions (if any)

Unhandled exception: System.AggregateException: One or more errors occurred. (The runtime identifier linux-arm64 is invalid. Valid runtime identifiers are: win-x64 win-arm64 osx-x64 osx-arm64.)
 ---> Microsoft.DotNet.Cli.Utils.GracefulException: The runtime identifier linux-arm64 is invalid. Valid runtime identifiers are: win-x64 win-arm64 osx-x64 osx-arm64.
   at Microsoft.DotNet.ShellShim.ShellShimTemplateFinder.ResolveAppHostSourceDirectoryAsync(String archOption, NuGetFramework targetFramework, Architecture arch)
   --- End of inner exception stack trace ---
   at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
   at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
   at System.Threading.Tasks.Task`1.get_Result()
   at Microsoft.DotNet.Tools.Tool.Install.ToolInstallGlobalOrToolPathCommand.Execute()
   at Microsoft.DotNet.Tools.Tool.Install.ToolInstallCommand.Execute()
   at Microsoft.DotNet.Cli.ToolInstallCommandParser.<>c.<ConstructCommand>b__14_0(ParseResult parseResult)
   at Microsoft.DotNet.Cli.ParseResultCommandHandler.Invoke(InvocationContext context)
   at System.CommandLine.Invocation.InvocationPipeline.<>c__DisplayClass4_0.<<BuildInvocationChain>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass12_0.<<UseHelp>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<UseSuggestDirective>b__18_0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass16_0.<<UseParseDirective>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass8_0.<<UseExceptionHandler>b__0>d.MoveNext()

Further technical details

dotnet --info
dotnet --info
.NET SDK (reflecting any global.json):
 Version:   6.0.302
 Commit:    c857713418

Runtime Environment:
 OS Name:     amzn
 OS Version:  2
 OS Platform: Linux
 RID:         linux-arm64
 Base Path:   /home/bambooagent/dotnet/sdk/6.0.302/

global.json file:
  Not found

Host:
  Version:      6.0.7
  Architecture: arm64
  Commit:       0ec02c8c96

.NET SDKs installed:
  3.1.422 [/home/bambooagent/dotnet/sdk]
  6.0.302 [/home/bambooagent/dotnet/sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 3.1.28 [/home/bambooagent/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 6.0.7 [/home/bambooagent/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 3.1.28 [/home/bambooagent/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.7 [/home/bambooagent/dotnet/shared/Microsoft.NETCore.App]

Download .NET:
  https://aka.ms/dotnet-download

Learn about .NET Runtimes and SDKs:
  https://aka.ms/dotnet/runtimes-sdk-info
  • The IDE (VS / VS Code/ VS4Mac) you’re running on, and its version

Issue Analytics

  • State:open
  • Created 10 months ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
dsplaistedcommented, Nov 17, 2022

I’m not sure why the list of RuntimeIdentifiers is hardcoded there. Looking at the code it looks like you can’t install global tools at all on Linux, though I may be missing something.

Ideally I think the same data that goes in to Microsoft.NETCoreSdk.BundledVersions.props about what RIDs are available for apphosts should be used to drive the tool install too.

0reactions
cn-mlcommented, Jun 6, 2023

I get the same output when cross-building AMD64 / ARM64 Docker images on either host machine architecture, but only when I supply the architecture flag to docker tool install.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to install the ML.NET Command-Line Interface (CLI) tool
The tool is only available for each user profile where the tool was installed. Global Tools can also be installed in a specific...
Read more >
Setup .NET Runtime and SDK on Raspberry Pi 4
However, Ubuntu for Raspberry Pi 4 can install ARM64 . ... For reference: https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-publish.
Read more >
Dotnet build linux. The answer you're looking for is basically
NET development tools for Windows, Linux, and macOS. ... F#, and Visual Basic When you run dotnet build, dotnet run doesn't work for...
Read more >
Building Multi-Architecture Docker Images on ARM 64-bit ...
CAT Tool · Machine Translation · Transcreation Tool ... CACHED [linux/arm64 2/2] RUN apk add util-linux => exporting to image => => exporting...
Read more >
Install and Set Up kubectl on Linux
Install Tools · Install and Set Up kubectl on Linux · Install and Set Up kubectl on macOS · Install and Set Up...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found