【问题标题】:dotnet --version gives "the folder [/usr/local/share/dotnet/host/fxr] does not contain any version-numbered child folders"dotnet --version 给出“文件夹 [/usr/local/share/dotnet/host/fxr] 不包含任何版本编号的子文件夹”
【发布时间】:2023-01-19 01:51:27
【问题描述】:

当我在 Mac 的终端中运行 dotnet --version 时出现错误:

发生致命错误,文件夹 [/usr/local/share/dotnet/host/fxr] 不包含任何版本编号的子文件夹

它可以找到 dotnet 可执行文件,但 --version 不工作:

anasmahdi@Anass-Air ~ % dotnet

Usage: dotnet [options]
Usage: dotnet [path-to-application]

Options:
  -h|--help         Display help.
  --info            Display .NET information.
  --list-sdks       Display the installed SDKs.
  --list-runtimes   Display the installed runtimes.

path-to-application:
  The path to an application .dll file to execute.
anasmahdi@Anass-Air ~ % dotnet --version
A fatal error occurred, the folder [/usr/local/share/dotnet/host/fxr] does not contain any version-numbered child folders
anasmahdi@Anass-Air ~ % 

【问题讨论】:

    标签: .net macos ssl terminal command


    【解决方案1】:

    我也有这个问题,在 M1 Mac 上。因为 /usr/local/share/dotnet/ 在我的 $PATH 里面(我仍然不知道为什么),它正在查看错误的 dotnet 可执行文件:

    运行后

    sudo ln -s /usr/local/share/dotnet/dotnet /usr/local/bin/
    

    here所述并重新启动终端,问题就消失了。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2022-09-30
      • 1970-01-01
      • 2017-05-12
      • 1970-01-01
      • 2017-03-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多