【发布时间】:2016-11-04 13:02:32
【问题描述】:
我正在关注这里的 EntityFrameworkCore 教程 https://docs.efproject.net/en/staging/platforms/aspnetcore/new-db.html 但是当我到达教程的创建数据库部分时 https://docs.efproject.net/en/staging/platforms/aspnetcore/new-db.html#create-your-database 并运行命令 Add-Migration MyFirstMigration 我收到以下错误:
Cannot execute this command because Microsoft.EntityFrameworkCore.Design is not installed. Install the version of that package that matches the installed version of Microsoft.EntityFrameworkCore and try again.
我尝试在 NuGet 上安装 Microsoft.EntityFrameworkCore.Design 以及 Microsoft.EntityFrameworkCore.SqlServer.Design 的每个版本,但仍然遇到相同的错误。
我还尝试使用命令在 NuGet PM 之外运行
- dotnet 恢复
- dotnet ef 迁移添加 MyFirstMigration
并得到以下错误:
Unhandled Exception: System.MissingMethodException: Entry point not found in assembly 'Microsoft.EntityFrameworkCore.Design, Version=1.1.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'.
我尝试了所有我能想到的东西,并在互联网上到处寻找,但仍然找不到答案。
【问题讨论】:
-
您可能应该发布您的 project.json - 通常可以在那里确定问题。
-
看这个链接,也许对你有帮助:stackoverflow.com/a/66618882/7890100
标签: c# entity-framework visual-studio nuget entity-framework-core