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

3

5

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?

Bankroll answered 13/12, 2023 at 17:51 Comment(0)
L
8

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.

Letter answered 13/12, 2023 at 23:44 Comment(2)
I just deleted the /etc/dotnet folder, which worked for me. Related dotnet issue: github.com/dotnet/runtime/issues/82858Glucoside
this is correct, saved me after 10 hours of pulling my hair out... :)Amphibolous
B
1

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.

Bankroll answered 13/12, 2023 at 20:29 Comment(0)
C
0

I found that I had a global.json in the root directory of my project that looked like this:

{
  "sdk": {
    "version": "3.1.0",
    "rollForward": "latestFeature",
    "allowPrerelease": false
  }
}

Updating version to 8.0.403 allowed net6.0 and net8.0 to appear in Rider's Edit target framework dialog.

Cultus answered 23/10 at 19:20 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.