dotnet-serve icon indicating copy to clipboard operation
dotnet-serve copied to clipboard

Can't find runtime on Amazon Linux EC2 instance

Open attilah opened this issue 1 year ago • 1 comments

Describe the bug Tried to run dotnet serve on a x64 AL EC2 instance and run into issues.

.NET SDK 8 and runtime is installed and confirmed working.

To Reproduce Steps to reproduce the behavior:

  1. Launch an EC2 instance with x64 architecture and Amazon Linux
  2. Install .NET 8 with the MSFT shell script as suggested
  3. Install dotnet serve
  4. Update .bashrc as requested
  5. Make sure dotnet functions correctly with dotnet --list-sdks and dotnet --list-runtimes
  6. Run dotnet serve in a directory.

Expected behavior dotnet serve starts

Screenshots This is the output in the shell upon running:

[ec2-user@]$ dotnet --list-runtimes
Microsoft.AspNetCore.App 8.0.1 [/home/ec2-user/.dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 8.0.1 [/home/ec2-user/.dotnet/shared/Microsoft.NETCore.App]
[ec2-user@]$ dotnet --list-sdks
8.0.101 [/home/ec2-user/.dotnet/sdk]
[ec2-user@]$ dotnet serve
You must install .NET to run this application.

App: /home/ec2-user/.dotnet/tools/dotnet-serve
Architecture: x64
App host version: 8.0.1
.NET location: Not found

Learn more:
https://aka.ms/dotnet/app-launch-failed

Download the .NET runtime:
https://aka.ms/dotnet-core-applaunch?missing_runtime=true&arch=x64&rid=linux-x64&os=amzn.2023&apphost_version=8.0.1
[ec2-user@]$

Additional context dotnet --info output:

.NET SDK:
 Version:           8.0.101
 Commit:            6eceda187b
 Workload version:  8.0.100-manifests.69afb982

Runtime Environment:
 OS Name:     amzn
 OS Version:  2023
 OS Platform: Linux
 RID:         linux-x64
 Base Path:   /home/ec2-user/.dotnet/sdk/8.0.101/

.NET workloads installed:
 Workload version: 8.0.100-manifests.69afb982
There are no installed workloads to display.

Host:
  Version:      8.0.1
  Architecture: x64
  Commit:       bf5e279d92

.NET SDKs installed:
  8.0.101 [/home/ec2-user/.dotnet/sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 8.0.1 [/home/ec2-user/.dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 8.0.1 [/home/ec2-user/.dotnet/shared/Microsoft.NETCore.App]

Other architectures found:
  None

Environment variables:
  Not set

global.json file:
  Not found

Learn more:
  https://aka.ms/dotnet/info

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

attilah avatar Jan 20 '24 08:01 attilah

Seems like an issue with .NET that would affect all CLI tools, not just this one, right? Or is there some kind of new packaging thing that breaks with .NET 8?

natemcmaster avatar Feb 19 '24 05:02 natemcmaster