1. 程式人生 > >EF Core 遷移過程遇到EF Core tools version版本不相符的解決方案

EF Core 遷移過程遇到EF Core tools version版本不相符的解決方案

如果你使用命令:

PM> add-migration Inital

提示如下資訊時:

The EF Core tools version '2.1.1-rtm-30846' is older than that of the runtime '2.1.4-rtm-31024'

解決方法大致一下幾種:

第一


最近在跟著官方的文件學習 .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 完成後執行可以了