The Entity Framework tools version '3.1.7' is older than that of the runtime '5.0.3'.
Context
When running EntityFramework commands, an warning is thrown out: The Entity Framework tools version '3.1.7' is older than that of the runtime '5.0.3'. Update the tools for the latest features and bug fixes.
The detailed error looks like the following:
The Entity Framework tools version '3.1.7' is older than that of the runtime '5.0.3'. Update the tools for the latest features and bug fixes. info: Microsoft.EntityFrameworkCore.Infrastructure[10403] Entity Framework Core 5.0.3 initialized 'ApplicationDbContext' using provider 'Microsoft.EntityFrameworkCore.SqlServer' with options: MigrationsAssembly=Kontext.DependencyInjection, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null Your target project 'Kontext.Web.Portals' doesn't match your migrations assembly 'Kontext.DependencyInjection, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. Either change your target project or change your migrations assembly. Change your migrations assembly by using DbContextOptionsBuilder. E.g. options.UseSqlServer(connection, b => b.MigrationsAssembly("***")). By default, the migrations assembly is the assembly containing the DbContext. Change your target project to the migrations project by using the Package Manager Console's Default project drop-down list, or by executing "dotnet ef" from the directory containing the migrations project.
Resolve this issue
As the error message points out, we just need to simply upgrade EF tool.
Running the following command line to update it:
dotnet tool update --global dotnet-ef
The output looks like the following text:
Tool 'dotnet-ef' was successfully updated from version '3.1.7' to version '5.0.3'.
Verify the tool
Type the following command to verify the tool:
dotnet ef
copyright
This page is subject to Site terms.
comment Comments
No comments yet.