Flo*_*res 16 entity-framework .net-core ef-core-2.1
如果我跑 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>
Run Code Online (Sandbox Code Playgroud)
这对我来说是正确的,版本2.1.1.所以我在这里检查了文档
他们建议csproj中的工具条目需要有这个包:
<ItemGroup>
<DotNetCliToolReference Include="Microsoft.EntityFrameworkCore.Tools.DotNet" Version="2.1.1" />
</ItemGroup>
Run Code Online (Sandbox Code Playgroud)
现在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工具列表-g'没有给我任何结果.
一切都很混乱.
旧版本来自哪里,如何摆脱它/更新它?
好的。
事实证明,这是由于安装了第二个最新的 sdk (2.1.301) 而导致的,但路径中的某处 global.json 固定为版本 2.1.300。
归档时间: |
|
查看次数: |
15340 次 |
最近记录: |