Rider 在工具中没有 EF 作为选项

Rider doesn't have EF as an option in tools

我正在尝试向我的 MVC NET.Core 项目添加迁移

https://blog.jetbrains.com/dotnet/2018/04/06/entity-framework-support-rider-2018-1/ 显示

After installing the EntityFramework NuGet package, we can initialize Entity Framework in our project from the project context menu, under Tools | Entity Framework | Initial setup.

实际上指出您必须右键单击项目并选择工具。

但是,我没有这个选项

更多研究,它展示了我如何通过 Rider 中的终端执行此操作。 https://blog.jetbrains.com/dotnet/2017/08/09/running-entity-framework-core-commands-rider/

这是我认为问题所在(或者以下是转移注意力的问题)

在终端中,我 CD 进入我的项目。我输入 dotnet restore 并完成

然后我输入 dotnet ef,我被告知

Could not execute because the specified command or file was not found.

我完全不明白为什么会这样。

我有一个变通方法 - 它在 Visual Studio 中完美运行,但我正在尝试学习另一个 IDE 并且想通过这个

有什么想法吗?最终,最好的选择是在 rider 中使用 Tools > EF 选项。

这将解决命令行问题

https://devblogs.microsoft.com/dotnet/announcing-entity-framework-core-3-1-and-entity-framework-6-4/

CD 到你的项目然后 运行

dotnet tool install --global dotnet-ef

根据@Niels Filter 评论,您可能需要

dotnet tool install --global dotnet-ef --version 3.1.0