【发布时间】:2019-02-06 02:02:49
【问题描述】:
当我在 VS 2017 包管理器控制台中使用 dotnet ef 工具时,我收到一条关于需要更新 EF Core 工具的警告消息:
PM> dotnet ef migrations list -s ../RideMonitorSite
The EF Core tools version '2.1.1-rtm-30846' is older than that of the runtime '2.1.2-rtm-30932'. Update the tools for the latest features and bug fixes.
20180831043252_Initial
但是我的 csproj 文件有这个条目:
<ItemGroup>
<DotNetCliToolReference Include="Microsoft.EntityFrameworkCore.Tools.DotNet" Version="2.1.2" />
</ItemGroup>
我已经确认安装的版本实际上已经过时了:
PM> dotnet ef --version
Entity Framework Core .NET Command-line Tools
2.1.1-rtm-30846
那么我该怎么做才能更新这些工具呢?顺便说一句,我在其他答案中看到过时的 global.json 文件可能会导致此问题。但是我在解决方案中的任何地方都没有 global.json 文件。
【问题讨论】:
-
我认为你可以删除对DotNetCliToolReference的引用,github.com/aspnet/EntityFramework.Docs/issues/708
-
感谢@AntonioCampagnaro 的建议。但是当我删除这些引用时,我仍然会收到警告消息。
-
通过包管理器控制台升级它,例如this answer