.NET location cannot be found in Linux on a Clean Template of AppHost Console
- Dominant language
- C#
- Stars
- 6.3k
- Forks
- 991
- Avg merge
- 2d 15h
- Merged PRs (30d)
- 196
Description
### Is there an existing issue for this?
- [x] I have searched the existing issues
### Describe the bug
I have created a new default Aspire project on Ubuntu, and when running it, the .NET location cannot be found.
I had problems also with aspire-cli, but this issue helps me: https://github.com/dotnet/aspire/issues/9783
Now, i can run aspire-cli correctly, but i cannot run a Clean AppHost Project
### Expected Behavior
_No response_
### Steps To Reproduce
aspire new
> AppHost and service defaults
dotnet build ./abc.AppHost/abc.AppHost.csproj -c Release -r linux-x64
dotnet build ./abc.ServiceDefaults/abc.ServiceDefaults.csproj -c Release -r linux-x64
(If i execute dotnet publish ./abc.sln , only builds Service Defaults project...)
sudo ./abc.AppHost/bin/Release/net9.0/linux-x64/abc.AppHost
### Exceptions (if any)
### .NET Version info
.NET SDK:
Version: 9.0.304
Commit: f12f5f689e
Workload version: 9.0.300-manifests.70d87660
MSBuild version: 17.14.16+5d8159c5f
Runtime Environment:
OS Name: ubuntu
OS Version: 24.04
OS Platform: Linux
RID: linux-x64
Base Path: /usr/share/dotnet/sdk/9.0.304/
.NET workloads installed:
There are no installed workloads to display.
Configured to use loose manifests when installing new manifests.
Host:
Version: 9.0.8
Architecture: x64
Commit: aae90fa090
.NET SDKs installed:
8.0.413 [/usr/share/dotnet/sdk]
9.0.304 [/usr/share/dotnet/sdk]
.NET runtimes installed:
Microsoft.AspNetCore.App 8.0.19 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 9.0.8 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 8.0.19 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 9.0.8 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
Other architectures found:
None
Environment variables:
DOTNET_ROOT [/usr/share/dotnet]
global.json file:
Not found
### Anything else?
dotnet --list-sdks
8.0.413 [/usr/share/dotnet/sdk]
9.0.304 [/usr/share/dotnet/sdk]
dotnet --list-runtimes
Microsoft.AspNetCore.App 8.0.19 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 9.0.8 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 8.0.19 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 9.0.8 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
which dotnet
/usr/bin/dotnet
echo $DOTNET_ROOT
/usr/share/dotnet
echo $PATH
/home/computer/.aspire/bin:/home/computer/.cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin:/home/computer/.dotnet/tools:/home/computer/.dotnet/tools:/home/computer/.influxdb/:/home/computer/.influxdb/:/home/computer/.dotnet:/home/computer/.dotnet/tools:/usr/share/dotnet:/usr/share/dotnet/tools:/usr/bin/dotnet:/usr/bin/dotnet/tools
Contributor guide
Assessment
This issue has not been assessed yet.