首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >找不到所需的库libhostfxr.so。Netcore

找不到所需的库libhostfxr.so。Netcore
EN

Stack Overflow用户
提问于 2022-02-24 12:29:57
回答 3查看 5.3K关注 0票数 3
代码语言:javascript
运行
复制
 ❯ dotnet ef   
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/ru/.dotnet/tools/.store/dotnet-ef/6.0.2/dotnet-ef/6.0.2/tools/netcoreapp3.1/any/].
If this is a framework-dependent application, install the runtime in the global location [/usr/share/dotnet] or use the DOTNET_ROOT environment variable to specify the runtime location or register the runtime location in [/etc/dotnet].

The .NET runtime can be found at:
  - https://aka.ms/dotnet-core-applaunch?missing_runtime=true&arch=x64&rid=arch-x64&apphost_version=6.0.2

~ 

如果在运行命令后没有运行,那么我能做什么呢?

EN

回答 3

Stack Overflow用户

回答已采纳

发布于 2022-02-24 12:29:57

通过将此添加到shell配置文件的任何部分(可以在末尾)解决这个问题:

代码语言:javascript
运行
复制
# Netcore
export PATH=$PATH:$HOME/.dotnet/tools
export DOTNET_ROOT=$HOME/.dotnet
export PATH=$PATH:$DOTNET_ROOT

您的shell配置文件可以位于以下其中一个文件中:

  • Bash Shell:~/.bash_profile,~/..bashrc
  • Korn:~/..kshrc还是.profile
  • Z壳:~/..zshrc或.zprofile

不要忘记关闭和打开终端,这样env变量就可以加载.

更多在这里

要检查是否一切正常,请运行dotnet ef,您应该得到如下内容:

代码语言:javascript
运行
复制
❯ dotnet ef

                     _/\__       
               ---==/    \\      
         ___  ___   |.    \|\    
        | __|| __|  |  )   \\\   
        | _| | _|   \_/ |  //|\\ 
        |___||_|       /   \\\/\\

Entity Framework Core .NET Command-line Tools 6.0.2

Usage: dotnet ef [options] [command]

Options:
  --version        Show version information
  -h|--help        Show help information
  -v|--verbose     Show verbose output.
  --no-color       Don't colorize output.
  --prefix-output  Prefix output with level.

Commands:
  database    Commands to manage the database.
  dbcontext   Commands to manage DbContext types.
  migrations  Commands to manage migrations.

Use "dotnet ef [command] --help" for more information about a command.
票数 4
EN

Stack Overflow用户

发布于 2022-02-25 02:48:24

尝试更新下面的配置,并使用dotnet的最新版本:

代码语言:javascript
运行
复制
export PATH="$PATH:$HOME/.dotnet/tools"
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"
票数 3
EN

Stack Overflow用户

发布于 2022-04-27 04:25:54

在使用止动版时,我得到了这个错误(以及许多其他错误)。当我切换到包管理器版本时,这些问题都消失了。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/71251998

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档