【发布时间】:2021-06-24 01:34:30
【问题描述】:
我正在 wsl2 中的 .net core 5 中开发一个 api,我按照所有文档安装实体框架核心工具。
当我跑步时
dotnet tool list -g
打印出来
Package Id Version Commands
--------------------------------------
dotnet-ef 5.0.7 dotnet-ef
但是当我跑步时
dotnet ef
或其任何子命令,我明白了
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.
现在,我已经查看了我的路径,它看起来就像我跑步时的样子
dotnet tool install --global dotnet-ef
它将它安装在我的 C 驱动器下,而不是在我认为可能是问题的 wsl2 中,但我不明白为什么在 ubuntu 中运行它会将它安装到我的 Windows 目录中,但这是我路径中的行
/mnt/c/Users/ethan/.dotnet/tools
所以我想我的问题是,它在我的 Windows 目录下未停止的问题,如果是这样,我如何强制它安装在 ububtu 上或更改我的路径,如果没有发生什么。
【问题讨论】:
标签: c# entity-framework .net-core command-line-interface wsl-2