Mac, 运行dotnet ef报错
来源:1-2 【讨论题】对于不断推出的新框架,我们应该如何学习?

慕移动8056989
2023-06-15
Could not execute because the specified command or file was not found.
Possible reasons for this include:
- You misspelled a built-in dotnet command.
- You intended to execute a .NET program, but dotnet-ef does not exist.
- You intended to run a global tool, but a dotnet-prefixed executable with this name could not be found on the PATH.
写回答
1回答
-
慕移动8056989
提问者
2023-06-15
网上找了帖子,说可能是因为dotnet-ef没装
dotnet tool install --global dotnet-ef
然后,又提示"/Users/[username]/.dotnet/tools"不在环境变量中,但是zsh给出了提示,运行一下代码
cat << \EOF >> ~/.zprofile
# Add .NET Core SDK tools
export PATH="$PATH:/Users/[username]/.dotnet/tools"
EOF
添加环境变量后,再运行dotnet ef,就显示可以用了
10
相似问题