natemcmaster / dotnet-serve

Simple command-line HTTPS server for the .NET Core CLI
https://nuget.org/packages/dotnet-serve/
Apache License 2.0
782 stars 65 forks source link

Can't find runtime on Amazon Linux EC2 instance #145

Open attilah opened 5 months ago

attilah commented 5 months ago

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
natemcmaster commented 4 months ago

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?