entity-framework-core - 需要更新 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 文件。
解决方案
对特定版本使用命令行、Cmd或PowerShell :
dotnet tool update --global dotnet-ef --version 3.1.0
或用于最新版本(也适用于重新安装):
dotnet tool update --global dotnet-ef
推荐阅读
- templates - 如何将所选元素转换为透明对象
- java - 无法在子包中创建类的实例
- php - 如何在 Lumen 中自定义 ValidationException 响应?
- tensorflow-federated - 为什么 tensorflow 联合的性能比单个 Keras 模型差
- javascript - 当原点实际上相同时,如何解决“帧被阻止......跨原点..”错误?
- assembly - 如何使计时器起作用?启动后 5 秒调用 int 4ah
- python - 循环numpy数组v/s映射函数?
- angular - 多点触控在 Chrome 中不起作用
- python - 我怎样才能得到百分比?
- ios - 自从向文本添加语音(语音识别)以来,文本到语音的音量显着下降