Cannot run project with Rider 2023 and dotnet-8.0 on Ubuntu 22.04.3

1k views Asked by At

I had dotnet-sdk-7.0 installed and everything worked perfectly. Yesterday I installed dotnet-sdk-8.0 from the Microsoft package repository removing the existing .NET packages from my distribution first: sudo apt remove 'dotnet*' 'aspnet*' 'netstandard*' And now Rider cannot run my project.

My system: Ubuntu 22.04.3 LTS

dotnet --info:

.NET SDK:
 Version:           8.0.100
 Commit:            57efcf1350
 Workload version:  8.0.100-manifests.6c33ef20

Runtime Environment:
 OS Name:     ubuntu
 OS Version:  22.04
 OS Platform: Linux
 RID:         linux-x64
 Base Path:   /usr/share/dotnet/sdk/8.0.100/

.NET workloads installed:
 Workload version: 8.0.100-manifests.6c33ef20
There are no installed workloads to display.

Host:
  Version:      8.0.0
  Architecture: x64
  Commit:       5535e31a71

.NET SDKs installed:
  8.0.100 [/usr/share/dotnet/sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 8.0.0 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 8.0.0 [/usr/share/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

Toolset and Build:enter image description here

Rider error:

/.../Project/src/Xxx.GraphQl/bin/Debug/net8.0/DataGateway.GraphQl
You must install .NET to run this application.

App: /.../Project/src/Xxx.GraphQl/bin/Debug/net8.0/DataGateway.GraphQl
Architecture: x64
App host version: 8.0.0
.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=ubuntu.22.04&apphost_version=8.0.0

Process finished with exit code 131.

Any ideas?

2

There are 2 answers

2
fyf On BEST ANSWER

Got exactly the same problem. For me solution was to edit

/etc/dotnet/install_location
/etc/dotnet/install_location_x64

/usr/share/dotnet instead of /usr/lib/dotnet

After that change everything works great.

0
Andriy On

Until someone posts a correct solution I'll present a temporary one. First of all, add an env variable:

DOTNET_ROOT="/usr/lib/dotnet"

Also, check that project properties are correct. Right-click on the folder with the project and select "Properties". Set the correct checkbox for "Target Framework". enter image description here It looks like the command sudo apt remove 'dotnet*' 'aspnet*' 'netstandard*' leaves some artifacts from the dotnet-sdk-7.0.