c# - Rider 工具中没有 EF 作为选项

标签 c# entity-framework rider

我正在尝试向我的 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.

JetBrains Rider enable-migrations for ASP.NET MVC on mac实际上指出您必须右键单击该项目并选择工具。

但是,我没有选择

enter image description here

更多研究表明我可以如何通过 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 中使用“工具”>“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

关于c# - Rider 工具中没有 EF 作为选项,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61137361/

相关文章:

c# - Entity Framework 5 : Why is my entity's collection property empty?

c# - 插入时的自引用主键

c# - Rider 编写 Roslyn 分析器

c# - unity 在最小和最大距离之间旋转

c# - Silverlight:在用户关注文本框时立即验证?

entity-framework - Entity Framework 4.3代码中的错误优先-索引已存在

c# - Jetbrains Rider + Visual Studio WPF

c# - 多个更新面板的问题

c# - Unity3D : Trying to make a custom Sleep/Wait function in C#

c# - 在 Jetbrains Rider 上构建时 Blazor App CS0103 错误,而在使用 VisualStudio 时没有错误