简体   繁体   中英

The framework 'Microsoft.NETCore.App', version '5.0.13' was not found

at the terminal of CentOS 8, I try to run the following:

dotnet -h

Error message:

The framework 'Microsoft.NETCore.App', version '5.0.13' was not found.

I have no idea of what is happening.

在此处输入图像描述

I have tried lots of instructions around the Google. Some of the steps that I have tried is as follow:

https://docs.microsoft.com/en-us/dotnet/core/versions/selection\

https://docs.microsoft.com/en-us/dotnet/core/install/linux-centos

https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-run

sudo dnf install dotnet-sdk-5.0
sudo dnf install aspnetcore-runtime-5.0
sudo dnf install dotnet-runtime-5.0

I also tried Enable snaps on CentOS and install .NET Runtime 5.0

https://snapcraft.io/install/dotnet-runtime-50/centos

sudo yum install epel-release
sudo yum install snapd
sudo systemctl enable --now snapd.socket
sudo ln -s /var/lib/snapd/snap /snap
sudo snap install dotnet-runtime-50

but none of this resolve the problem.


Update: Jan 26th 2022

Enter the following command:

dotnet --info

will get the following message:

点网--信息

Then, I follow this steps explained at:

https://docs.microsoft.com/en-us/dotnet/core/install/linux-package-mixup

by uninstalling and reinstalling the dotnet

sudo dnf remove packages-microsoft-prod
sudo dnf remove 'dotnet*' 'aspnet*' 'netstandard*'
sudo dnf install dotnet-sdk-5.0

then, I try the following:

dotnet --info

the system says something like (forget to screenshot):

dotnet cannot be found at
/user/var/bin/.... dotnet...
(I forget the exact path)

This is taking too much time to fix... that I have a more important task to do. I end up giving up to do further debugging this error. I deleted the CentOS and reinstall a brand new clean CentOS and start all over again. I believe I must have messed up multiple conflicting dotnet version and multiple error caching.

I will post another update once I have completed reinstalling new CentOS.


Update 2: Jan 26th 2022 (Fixed)

Ok guys, the problem is fixed. By combining all the tips that you have provided, here is what I have done:

First, do a new clean installation of CentOS 8

Proceed to install the "dotnet"

sudo dnf install dotnet-sdk-3.1
sudo dnf install dotnet-sdk-5.0

Test by running a console app:

dotnet ConsoleApp2.dll

Everything works perfectly fine now. Thank you very much for your time and help.

Multiple source of dotnet runtime and sdk had been installed. This resulting multiple conflicting binary path and assembly caching crash.

Step 1: Do a clean installation of CentOS

Step 2: Install required runtime version, for example:

sudo dnf install dotnet-sdk-3.1
sudo dnf install dotnet-sdk-5.0

Step 3: Test by running a console app:

dotnet ConsoleApp.dll

done

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM