skip to Main Content

Like as dotnet/dotnet-docker#1537
but I have same error on CenOS 8 (not Docker) on standalone machine.
Clean new CentOS 8 with latest updates on 23 dec 2020.
in console:

sudo dnf install aspnetcore-runtime-3.1 – OK

dotnet – OK (shows using manual)

dotnet --info – error:

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

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

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

the folder /usr/share/dotnet/host/fxr is really empty. Trying to install SDK – no effect

2

Answers


  1. I had the same problem after updating my system to Fedora 32. The problem was, that I had installed dotnet-runtime-2.1 before, but Fedora 32 comes with 3.1 included.

    If your dotnet application is compatible with 3.1, you can simply uninstall the old runtime. That’s how I did it:

    1. Check installed dotnet runtimes:
    $ 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
    

    In my case, version 2.1 was installed by myself. 3.1 was installed by the system (tagged with fc32)

    1. Remove the old version:
    dnf remove dotnet-runtime-2.1
    
    1. To install 2.1, I had to add the microsoft repo before, which is not needed anymore:
    rm /etc/yum.repos.d/microsoft-prod.repo
    
    1. For some unknown reason, uninstalling 2.1 also uninstalled 3.1. Install it as you usually would:
     dnf install dotnet-runtime-3.1
    
    1. dotnet --info should work again.

    For more information or if your application requires dotnet 2.1:

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

    Login or Signup to reply.
  2. If the dotnet sdk is version 5.0

    step 1.- Remove sdk

    sudo dnf remove dotnet-sdk-5.0
    

    step 2.- remove folders

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

    step 4.- Clean and upgrade.

    sudo dnf clean all
    sudo dnf upgrade
    

    step 5.- Reboot system

    sudo init 6
    

    step 6.- Finally

    sudo dnf install dotnet-sdk-5.0
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search