gpt4 book ai didi

entity-framework - EF Core 工具版本更新 2.1.1

转载 作者:行者123 更新时间:2023-12-03 15:01:46 24 4
gpt4 key购买 nike

如果我运行 dotnet ef add testmigration
我收到此警告:The EF Core tools version '2.1.0-rtm-30799' is older than that of the runtime '2.1.1-rtm-30846'. Update the tools for the latest features and bug fixes.
所以我检查了我的 csproj 文件:

<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。
所以我检查了文档, here

他们建议csproj中的工具条目需要有这个包:
<ItemGroup>
<DotNetCliToolReference Include="Microsoft.EntityFrameworkCore.Tools.DotNet" Version="2.1.1" />
</ItemGroup>

现在是 dotnet restore提示:
warning : The tool 'Microsoft.EntityFrameworkCore.Tools.DotNet' is now included in the .NET Core SDK. Information on resolving this warning is available at (https://aka.ms/dotnetclitools-in-box).
dotnet ef --version仍然列出旧的。

所以接下来我要做的是删除 csproj 中的条目。全部,现在 dotnet ef仍然有效,但仍然给我旧版本。

所以我想我必须以某种方式更新 EF 的 dotnet 全局工具。但是“dotnet tools list -g”没有给我任何结果。

一切都非常困惑。

旧版本来自哪里,我如何摆脱它/更新它?

最佳答案

install-package Microsoft.EntityFrameworkCore.Tools -Version 2.1.8

为我做的

关于entity-framework - EF Core 工具版本更新 2.1.1,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51284974/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com