dotnet / sdk

Core functionality needed to create .NET Core projects, that is shared between Visual Studio and CLI
https://dot.net/core
MIT License
2.75k stars 1.07k forks source link

dotnet command fails after installing .NET SDK 8.0.403 on Mariner 2.0 #44372

Closed damonbarry closed 1 month ago

damonbarry commented 1 month ago

Describe the bug

If I install .NET SDK 8.0.402 on a fresh Mariner VM (in Azure cloud) and do dotnet --version, the version is printed and the command has an exit status of 0. However, if I install the latest version, 8.0.403, dotnet --version prints an error message and has an exit status of 150.

To Reproduce

Create a Mariner 2.0 VM in Azure from PowerShell:

$image = 'MicrosoftCBLMariner:cbl-mariner:cbl-mariner-2:latest'
$location = 'westus2'
$nsg = "${env:USERNAME}-nsg"
$prefix = "${env:USERNAME}-mariner2-1"
$rg = "${env:USERNAME}-rg"
$sshkeypath = "$env:USERPROFILE\.ssh\id_rsa.pub"
$subnet = "${env:USERNAME}-subnet"
$subscription = '<Azure subscription name>'
$vmsize = 'Standard_D4ds_v5'
$vnet = "${env:USERNAME}-vnet"
az login
az account set -s $subscription
az group create --name $rg --location $location
az network nsg create --resource-group $rg --name $nsg --location $location
az network vnet create --resource-group $rg --name $vnet --location $location --subnet-name $subnet --nsg $nsg
az network public-ip create --resource-group $rg --name $prefix-ip --location $location --sku standard
az network nic create --resource-group $rg --name $prefix-nic --location $location --public-ip-address $prefix-ip --vnet-name $vnet --subnet $subnet
az vm create --name $prefix-vm --resource-group $rg --location $location --size $vmsize --image $image --admin-username azureuser --ssh-key-values $sshkeypath --nics $prefix-nic

Then SSH into the VM and run:

sudo dnf -y upgrade
sudo dnf install -y dotnet-sdk-8.0-8.0.402-1.x86_64
dotnet --version
echo $?

The output of the last two commands:

$ dotnet --version
8.0.402
$ echo $?
0

Then run:

sudo dnf remove -y dotnet-sdk-8.0-8.0.402-1.x86_64
sudo dnf install -y dotnet-sdk-8.0-8.0.403-1.x86_64
dotnet --version
echo $?

The output of the last two commands:

$ dotnet --version
You must install or update .NET to run this application.

App: /usr/share/dotnet/sdk/8.0.403/dotnet.dll
Architecture: x64
Framework: 'Microsoft.NETCore.App', version '8.0.10' (x64)
.NET location: /usr/share/dotnet/

The following frameworks were found:
  8.0.8 at [/usr/share/dotnet/shared/Microsoft.NETCore.App]

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

To install missing framework, download:
https://aka.ms/dotnet-core-applaunch?framework=Microsoft.NETCore.App&framework_version=8.0.10&arch=x64&rid=linux-x64&os=mariner.2.0
$ echo $?
150
baronfel commented 1 month ago

@richlander / @leecow who controls mariner package availability? Are we missing the aspnet framework packages for 8.0.403/8.0.10?

leecow commented 1 month ago

Apologies for the miss. Mariner 2 has been updated and validated with 8.0.403.

baronfel commented 1 month ago

Thanks @leecow - @damonbarry if you are able to update please let us know!

damonbarry commented 1 month ago

@leecow @baronfel Thanks that worked!