.NET Core EF 版本问题

最近在跟着官方的文档学习 .NET Core 。

在写 “创建 Razor 页面 Web 应用” Demo 中的——“添加模型”这一篇的教程,“添加初始迁移”中遇到 “The EF Core tools version '2.1.1-rtm-30846' is older than that of the runtime '2.1.3-rtm-32065'. Update the tools for the latest features and bug fixes.”这样的问题。

这个问题是用 PMC 命令做“初始迁移”的时候出现的,找了很多方法都不行,也看了本机安装的 .NET Core 的版本(dotnet --version,dotnet --info)。

最后解决办法:

项目文件夹下使用 .NET Core CLI 命令:

dotnet ef migrations add Initial

dotnet ef database update

完成后运行可以了

猜你喜欢

转载自www.cnblogs.com/zhurong/p/9747931.html