在Rider 中使用Entity Framework Core UI 插件创建EFCore 的 Migration迁移文件时报错

发布时间 2023-11-17 20:53:00作者: 閖

报错信息

  • EF Core tools are required to execute this action
  • 在点击报错信息中的发Fix进行安装时,再次出错
  • 这次是提示版本不匹配
    • 这里我使用的是EF Core 7.0.14版本的

报错原因

  1. 没有安装 dotnet tool
  2. 点击Fix进行安装时,是安装的最新版,是要是.net7的

安装 dotnet tool

直接在cmd中进行全局安装

这里要注意的是,安装的版本号,跟你的.Core对应版本的。

执行 dotnet ef 出现独角兽则怎么成功了。

参考:
https://blog.csdn.net/qq_16550591/article/details/133896831
https://learn.microsoft.com/zh-cn/ef/core/cli/dotnet
总之环境:

  • .net6
  • EFCore 选择的版本为 7.0.14
  • 安装dotnet tool 选择的版本为 7.0.14