A fatal error occurred. The folder [/usr/share/dotnet/host/fxr] does not exist.
Today I came across this problem while trying to use dotnet core on my Ubuntu 22.04.2 system.
The below message was displayed when running dotnet commands like dotnet new
and dotnet run
.
A fatal error occurred. The folder [/usr/share/dotnet/host/fxr] does not exist.
This problem seems to be potentially related to the different packages provided by the Ubuntu feed and the Microsoft feed, more info on that over here
To fix this I followed the below steps…
- Remove all your current dotnet installations using
sudo apt remove 'dotnet*' 'aspnet*' 'netstandard*'
- If it doesn’t already exist create the following
touch /etc/apt/preferences
- Open /etc/apt/preferences with a text editor and add the below
Package: dotnet* aspnet* netstandard*
Pin: origin "packages.microsoft.com"
Pin-Priority: -10
- Install dotnet following the steps here
Hopefully that solves it for you!
Health ❤️ ❤️ ❤️ ❤️ ❤️
See you soon 🗡️
Read other posts