当我add-migration收到这个警告时:
The EF Core tools version '2.1.1-rtm-30846' is older than that of the runtime '2.1.4-rtm-31024'. Update the tools for the latest features and bug fixes.
Run Code Online (Sandbox Code Playgroud)
我没有找到任何信息如何更新这个,除了更新DotNET核心SDK,但这对我没有用.
如果我跑 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 …