EF Core工具版本更新2.1.1 [英] EF Core tools version update 2.1.1

查看:92
本文介绍了EF Core工具版本更新2.1.1的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我运行 dotnet ef添加testmigration

我收到此警告: EF Core工具版本 2.1.0-rtm-30799比运行时版本 2.1.1-rtm-30846更旧。更新工具以获取最新功能和错误修复。

所以我检查了我的csproj文件:

So I checked my csproj file:

<ItemGroup>
    <PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="2.1.1" />
    <PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="2.1.1" />
    <PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="2.1.1" />
    <PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="2.1.1" />
</ItemGroup>

对我来说,版本2.1.1看起来正确。
所以我在此处

Which looks correct to me, version 2.1.1. So I checked the docs, here

他们建议csproj中的工具条目必须具有以下软件包:

And they suggest the tools entry in the csproj needs to have this package:

<ItemGroup>
    <DotNetCliToolReference Include="Microsoft.EntityFrameworkCore.Tools.DotNet" Version="2.1.1" />
</ItemGroup>

现在 dotnet还原抱怨:

警告:.NET Core SDK中现已包含工具 Microsoft.EntityFrameworkCore.Tools.DotNet。有关解决此警告的信息,请访问(https://aka.ms/dotnetclitools-in-box)。

dotnet ef --version 仍然列出了旧版本。

因此,我下一步要做的是删除<$中的条目。 c $ c> csproj 完全可以使用,现在 dotnet ef 仍然可以使用,但是仍然提供旧版本。

So the next thing I do is remove the entry in the csproj altogether, now dotnet ef still works, but still gives me the old version.

所以我想我必须以某种方式更新EF的dotnet全局工具。但是'dotnet工具列表-g'给我没有结果。

So I figured I somehow must update the dotnet global tools for EF. But a 'dotnet tools list -g' gives me no results.

一切都很混乱。

在哪里

推荐答案

好。

事实证明,这是由于安装了第二个最新的sdk(2.1.301)引起的,但是它是将global.json固定在版本2.1.300上的。

Turns out that this is caused by having the second latest sdk installed (2.1.301), but somewhere in the path a global.json pinned to version 2.1.300.

这篇关于EF Core工具版本更新2.1.1的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆