当我运行 dotnet --version
在我的 Mac 上的终端中,它给出了一个错误:
A fatal error occurred, the folder [/usr/local/share/dotnet/host/fxr] does not contain any version-numbered child folders
它可以找到
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 ~ %
最佳答案
我也有这个问题,在 M1 Mac 上。因为/usr/local/share/dotnet/
在我的$PATH
里面(还是不知道为什么),是看错了dotnet
可执行:
运行后
sudo ln -s /usr/local/share/dotnet/x64/dotnet /usr/local/bin/
如所述here并重新启动终端,问题就消失了。
关于.net - dotnet --version 给出 "the folder [/usr/local/share/dotnet/host/fxr] does not contain any version-numbered child folders",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/71151618/