Entity Framework Core 中的添加迁移错误

2024-01-02

我正在关注 Julie Lerman 的 Entity Framework Core 2.0 入门教程。我已经安装了 Microsoft.EntityFrameworkCore.SqlServer 版本 2.0.2。当我尝试在 VS 2017 中运行 add-migration initial (包管理器控制台)时,出现以下错误:

System.IO.FileLoadException: Could not load file or assembly 'Microsoft.EntityFrameworkCore.SqlServer, Version=2.0.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) File name: 'Microsoft.EntityFrameworkCore.SqlServer, Version=2.0.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' 当我跑步时dotnet --version i get 2.1.3.任何人都可以帮我纠正这个错误。

截屏 :

提前致谢。


在观看相同的 Pluralsight 视频后,我遇到了同样的问题。运行后:

PM> install-package Microsoft.EntityFrameworkCore.SqlServer

默认项目 set to SomeUI

我能够得到add-migration initial这样做之后运行没有任何问题。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Entity Framework Core 中的添加迁移错误 的相关文章

随机推荐