Problem with dotnet framework

Hello friends,
I have programmed with dotnet on Manjaro for ages. Last week, I reinstalled Manjaro for some reason and now, I just do not manage to make it run again. I have read hundreds of different articles, but nothing rally helps. It seems like everything is installed, but it still says, that the framework is not there.

Here are the outputs of some commands:

➜  ~ dotnet --list-sdks
6.0.126 [/usr/share/dotnet/sdk]
8.0.102 [/usr/share/dotnet/sdk]
➜  ~ dotnet --info
.NET SDK:
 Version:           8.0.102
 Commit:            b7800db369
 Workload version:  8.0.100-manifests.03fa9662

Runtime Environment:
 OS Name:     manjaro
 OS Version:  
 OS Platform: Linux
 RID:         arch-x64
 Base Path:   /usr/share/dotnet/sdk/8.0.102/

.NET workloads installed:
 Workload version: 8.0.100-manifests.03fa9662
There are no installed workloads to display.

Host:
  Version:      8.0.2
  Architecture: x64
  Commit:       1381d5ebd2

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

.NET runtimes installed:
  Microsoft.AspNetCore.App 6.0.26 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 8.0.2 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 6.0.26 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 8.0.2 [/usr/share/dotnet/shared/Microsoft.NETCore.App]

Other architectures found:
  None

Environment variables:
  DOTNET_ROOT       [/usr/share/dotnet/]

global.json file:
  Not found

Learn more:
  https://aka.ms/dotnet/info

Download .NET:
  https://aka.ms/dotnet/download
➜  ~ dotnet --list-runtimes
Microsoft.AspNetCore.App 6.0.26 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 8.0.2 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 6.0.26 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 8.0.2 [/usr/share/dotnet/shared/Microsoft.NETCore.App]

So it seems that I have installed both version 6 and 8 on my machine and that DOTNET_ROOT is set correctly (according to what they say in the Internett).

The way I have installed those is like this:

trizen -S dotnet-runtime
trizen -S dotnet-runtime-6.0
trizen -S dotnet-sdk
trizen -S dotnet-sdk-6.0
trizen -S aspnet-runtime
trizen -S aspnet-runtime-6.0

I am actually not sure if I actually need aspnet, since there have been different manuals in the Internet, but it does not work both with and without it.

So what is actually not working? I am using Rider and it seems like I can build projects.
But when I try to use dotnet start or watch, I get this:
The imported project "/usr/share/dotnet/sdk/8.0.102/Microsoft/VisualStudio/v17.0/WebApplications/Microsoft.WebApplication.targets" was not found. Confirm that the expression in the Import declaration "/usr/share/dotnet/sdk/8.0.102/Microsoft/VisualStudio/v17.0/WebApplications/Microsoft.WebApplication.targets" is correct, and that the file exists on disk. /home/Workspace/DotnetTest1/DotnetTest1/DotnetTest1.csproj

I also get this one in the IDE:
One or more types required to compile a dynamic expression cannot be found. Are you missing references to Microsoft.CSharp.dll and System.Core.dll?

I have searched the Internet, but I don’t find what is wrong here, is there somebody who can encrypt the obvious to me?

Why do you need help then?

Your project could be copied from a Windows system?

But you are obviously missing references in your project.

In Rider rightclick the project dependencies and click on Reference

Rightclick your project(s) in Rider and select Properties - ensure you are targeting the correct dotnet version - also check the Language version - I am using C#.


I am using Rider and dotnet8 - but I do not use the repo package - I use a custom script.

I use it because I can keep up with the security patches provided from the official downloads at dotnet.microsoft.com

dotnet on my system
 $ dotnet --list-sdks
8.0.203 [/usr/share/dotnet/sdk]

 $ dotnet --info
.NET SDK:
 Version:           8.0.203
 Commit:            5e1ceea679
 Workload version:  8.0.200-manifests.a7f084b6

Runtime Environment:
 OS Name:     manjaro
 OS Version:  
 OS Platform: Linux
 RID:         linux-x64
 Base Path:   /usr/share/dotnet/sdk/8.0.203/

.NET workloads installed:
 [wasm-tools]
   Installation Source: SDK 8.0.200
   Manifest Version:    8.0.3/8.0.100
   Manifest Path:       /usr/share/dotnet/sdk-manifests/8.0.100/microsoft.net.workload.mono.toolchain.current/8.0.3/WorkloadManifest.json
   Install Type:        FileBased


Host:
  Version:      8.0.3
  Architecture: x64
  Commit:       9f4b1f5d66

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

.NET runtimes installed:
  Microsoft.AspNetCore.App 8.0.3 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 8.0.3 [/usr/share/dotnet/shared/Microsoft.NETCore.App]

Other architectures found:
  None

Environment variables:
  DOTNET_ROOT       [/usr/share/dotnet]

global.json file:
  Not found

Learn more:
  https://aka.ms/dotnet/info

Download .NET:
  https://aka.ms/dotnet/download

Do not build using an AUR helper but do it natively using makepkg - especially note the pinned comment (this is the custom PKGBUILD which I use as base)

git clone https://aur.archlinux.org/dotnet-host-bin.git
cd dotnet-host-bin
makepkg -is

The build will provide the following - thus creating a complete environment

  • aspnet-runtime-bin
  • aspnet-targeting-pack-bin
  • dotnet-host-bin
  • dotnet-runtime-bin
  • dotnet-sdk-bin
  • dotnet-targeting-pack-bin
  • netstandard-targeting-pack-bin

However - It will not teach you how to reference assemblies in your project.

using System;