gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-04 10:14:39 33 4
gpt4 key购买 nike

我正在尝试向我的 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 中设置 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

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

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