繁体   English   中英

在 CentOS 8 上安装 dotnet/core/aspnet:3.1 时出错 - 文件夹 [/usr/share/dotnet/host/fxr] 不包含任何版本编号的子文件夹

[英]Error when install dotnet/core/aspnet:3.1 on CentOS 8 - Folder [/usr/share/dotnet/host/fxr] does not contain any version-numbered child folders

就像 dotnet/dotnet-docker#1537 但我在独立机器上的 CenOS 8(不是 Docker)上有同样的错误。 在 2020 年 12 月 23 日使用最新更新清洁新 CentOS 8。在控制台中:

sudo dnf install aspnetcore-runtime-3.1 - 好的

dotnet - 好的(使用手册显示)

dotnet --info - 错误:

A fatal error occurred, the folder [/usr/share/dotnet/host/fxr] does not contain any version-numbered child folders

dotnet --list-runtimes - 错误: A fatal error occurred, the folder [/usr/share/dotnet/host/fxr] does not contain any version-numbered child folders

dotnet *.dll - 错误: A fatal error occurred, the folder [/usr/share/dotnet/host/fxr] does not contain any version-numbered child folders

文件夹/usr/share/dotnet/host/fxr真的是空的。 尝试安装 SDK - 没有效果

将系统更新到 Fedora 32 后,我遇到了同样的问题。问题是,我之前安装了 dotnet-runtime-2.1,但 Fedora 32 附带了 3.1。

如果您的 dotnet 应用程序与 3.1 兼容,您可以简单地卸载旧的运行时。 我就是这样做的:

  1. 检查已安装的 dotnet 运行时:
$ rpm -qa | grep dotnet
dotnet-runtime-2.1-2.1.12-1.x86_64
dotnet-runtime-deps-2.1-2.1.12-1.x86_64
dotnet-hostfxr-2.1-2.1.12-1.x86_64
dotnet-host-3.1.10-1.fc32.x86_64

就我而言,2.1 版是我自己安装的。 3.1由系统安装(标记为fc32)

  1. 删除旧版本:
dnf remove dotnet-runtime-2.1
  1. 要安装 2.1,我必须先添加 microsoft repo,现在不再需要了:
rm /etc/yum.repos.d/microsoft-prod.repo
  1. 由于某些未知原因,卸载 2.1 也卸载了 3.1。 像往常一样安装它:
 dnf install dotnet-runtime-3.1
  1. dotnet --info应该再次工作。

如需更多信息或您的应用程序需要 dotnet 2.1:

https://github.com/dotnet/core/issues/4655

如果 dotnet sdk 是 5.0 版本

步骤 1.- 删除 sdk

sudo dnf remove dotnet-sdk-5.0

步骤 2.- 删除文件夹

sudo rm -rf /usr/share/dotnet
sudo rm -rf /usr/bin/dotnet
sudo rm -rf /etc/yum.repos.d/microsoft-prod.repo

步骤 4.- 清洁和升级。

sudo dnf clean all
sudo dnf upgrade

步骤 5.- 重启系统

sudo init 6

步骤 6.- 最后

sudo dnf install dotnet-sdk-5.0

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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