gpt4 book ai didi

entity-framework - 升级到 Visual Studio 16.3.0 后,dotnet ef 命令不再有效

转载 作者:行者123 更新时间:2023-12-02 06:46:54 26 4
gpt4 key购买 nike

这首先发生在家里,所以我认为这可能是我家里的台式电脑的问题。但是现在我回到工作岗位,我尝试了升级并得到了同样的结果。

升级前截图

dotnet ef command

升级 Visual Studio 后的屏幕截图

dotnet ef command

我得到的错误是:

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 Core 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 ef 命令。我的意思是之前必须在 $PATH 中,否则它之前不会工作。

最佳答案

这是一个 breaking change in Entity Framework Core 3.0 :

The EF Core command-line tool, dotnet ef, is no longer part of the .NET Core SDK.

...

Starting in 3.0, the .NET SDK does not include the dotnet ef tool, so before you can use it you have to explicitly install it as a local or global tool.

您需要安装 Entity Framework Core Tools .要全局安装它,请在命令行上运行:

dotnet tool install --global dotnet-ef

关于entity-framework - 升级到 Visual Studio 16.3.0 后,dotnet ef 命令不再有效,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58077073/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com