最近在跟着官方的文檔學習 .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
完成后運行可以了
