首页 > 解决方案 > 需要更新 EF Core 工具

问题描述

当我在 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 文件。

标签: entity-framework-core

解决方案


特定版本使用命令行、CmdPowerShell :

dotnet tool update --global dotnet-ef --version 3.1.0

或用于最新版本(也适用于重新安装)

dotnet tool update --global dotnet-ef


推荐阅读