.net-core - 升级到 macOS Catalina 后为 "zsh: command not found: dotnet-svcutil"

标签 .net-core zsh macos-catalina

将我的 macOS 升级到 10.15 (Catalina) 和 switching from bash to zsh 后按照建议,我尝试从终端启动 svcutil(或任何其他 .NET Core 工具),但收到以下错误消息:

zsh: command not found: dotnet-svcutil

奇怪,因为在使用 echo $PATH 检查路径时提到了它的位置(~/.dotnet/tools,默认安装 .NET Core 工具的位置) 。我该如何解决这个问题?

最佳答案

如上所述here , zsh 不支持路径中的 ~ 。 .NET Core 工具的路径条目在安装过程中作为文件 /etc/paths.d/dotnet-cli-tools 添加,路径条目为 ~/.dotnet/tools >。将其更改为 $HOME/.dotnet/tools${HOME}/.dotnet/tools 没有帮助,但将其更改为实际路径(例如 /Users/Glorfindel/.dotnet/tools)成功了。

另一个选择是重新安装该工具,例如与

dotnet tool uninstall --global dotnet-svcutil
dotnet tool install --global dotnet-svcutil

安装程序会告诉你以下信息,我没有尝试过:

Tools directory '/Users/Glorfindel/.dotnet/tools' is not currently on the PATH environment variable.
If you are using zsh, you can add it to your profile by running the following command:

cat << \EOF >> ~/.zprofile
# Add .NET Core SDK tools
export PATH="$PATH:/Users/Glorfindel/.dotnet/tools"
EOF

And run zsh -l to make it available for current session.

You can only add it to the current session by running the following command:

export PATH="$PATH:/Users/Glorfindel/.dotnet/tools"

关于.net-core - 升级到 macOS Catalina 后为 "zsh: command not found: dotnet-svcutil",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58320592/

相关文章:

.net-core - 'reportgenerator' 不是内部或外部命令,也不是可运行的程序或批处理文件

c# - 为池中的每个连接设置 MySql session 变量

zsh - : 39: source: not found While installing oh-my-zsh

zsh - 如何将函数/变量保持在我的 zshrc 本地?

android-studio - Flutter App Running Error : Dart can not be opened, 升级Catalina后无法验证开发者

.net - 我的Visual Studio中缺少.NET Core 2.0

c# - 不支持从 _ 到 _ 的关系,因为拥有的实体类型 _ 不能位于非所有权关系的主体端

zsh - 排除由 rsync 复制的具有特定扩展名集的文件

macos - 无法停止或阻止 apache 服务器在 macOS Catalina 上启动

python - SSL : CERTIFICATE_VERIFY_FAILED error with python3 on macOS 10. 15