The Entity Framework tools version '3.1.7' is older than that of the runtime '5.0.3'.
access_time 5 months ago languageEnglish
more_vert

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

visibility 270 comment 0

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.
Like this article?
Share on

Please log in or register to comment.

account_circle Log in person_add Register

Log in with external accounts

Follow Kontext

Get our latest updates on LinkedIn.

Want to contribute on Kontext to help others?

Learn more

More from Kontext

visibility 905
thumb_up 0
access_time 7 months ago
visibility 3240
thumb_up 0
access_time 4 years ago
C# 9.0 New Features
visibility 668
thumb_up 0
access_time 11 months ago