Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linux dotnet sdk error A fatal error occurred. The required library libhostfxr.so could not be found. #22509

Closed
robosthetique opened this issue Jun 7, 2021 · 1 comment
Labels
Source - Docs.ms Docs Customer feedback via GitHub Issue ⌚ Not Triaged

Comments

@robosthetique
Copy link

robosthetique commented Jun 7, 2021

Hey, I've added all the packages listed, but still running anything with dotnet aspnet-codegenerator, even just -h, gives the error:

A fatal error occurred. The required library libhostfxr.so could not be found.
If this is a self-contained application, that library should exist in [/home/usr/.dotnet/tools/.store/dotnet-aspnet-codegenerator/5.0.2/dotnet-aspnet-codegenerator/5.0.2/tools/net5.0/any/].

I'm working via the command line on Linux Mint, 5.4.0-52-generic, dotnet 5.0.300 installed via the dotnet-install.sh file currently given on the Install ASP.NET Core page on Jun 6 2021.

EDIT:
Fixed it.
From grantzvolsky at dotnet/sdk#9304
Put the following in a bash file and run it as source:

run this every time you open a new terminal as:

. ~whatever-path/new.sh or source ~whatever-path/new.sh

makes dotnet aspnet-codegenerator work

export DOTNET_ROOT=/snap/dotnet-sdk/current
export MSBuildSDKsPath=$DOTNET_ROOT/sdk/$(${DOTNET_ROOT}/dotnet --version)/Sdks
export PATH="${PATH}:${DOTNET_ROOT}"
export PATH="$PATH:$HOME/.dotnet/tools"


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

@dotnet-bot dotnet-bot added ⌚ Not Triaged Source - Docs.ms Docs Customer feedback via GitHub Issue labels Jun 7, 2021
@Rick-Anderson Rick-Anderson changed the title Linux dotnet sdk error Linux dotnet sdk error A fatal error occurred. The required library libhostfxr.so could not be found. Jun 7, 2021
@Rick-Anderson
Copy link
Contributor

@robosthetique thanks for the update

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Source - Docs.ms Docs Customer feedback via GitHub Issue ⌚ Not Triaged
Projects
None yet
Development

No branches or pull requests

3 participants