The Entity Framework tools version '3.1.7' is older than that of the runtime '5.0.3'.

visibility 859 access_time 2 years ago languageEnglish
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.

Please log in or register to comment.

account_circle Log in person_add Register

Log in with external accounts

timeline Stats
Page index 1.95
More from Kontext
Get Started on Reunified .NET 5
visibility 143
thumb_up 0
access_time 2 years ago
Get Started on Reunified .NET 5
[Link] Build SPA on ASP.NET Core with JavaScript Services
visibility 1,008
thumb_up 0
access_time 2 years ago
LINQ to SQL - Select N Random Records
visibility 1,055
thumb_up 0
access_time 2 years ago