Reputation: 2627
When I add-migration
i got this warning:
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.
I haven't found any information how can I update this, except with updating DotNET Core SDK, but this hasn't worked for me.
Upvotes: 63
Views: 32376
Reputation: 1
Program.cs is missing this code:
builder.Services.AddDbContext<AppDbContext>(options =>
options.UseSqlServer(builder.Configuration.GetConnectionString("DefaultConnection")));
Call the dbContext
Upvotes: -2
Reputation: 111
Issue: This issue I was getting: The Entity Framework tools version '5.0.2' is older than that of the runtime '7.0.1'. Update the tools for the latest features and bug fixes. See https://aka.ms/AAc1fbw for more information.
Tried the following solutions:
Upvotes: 2
Reputation: 1413
To piggyback on daniel-chikaka's solution, if you are still seeing the error after running the update command for the global environment.
dotnet tool update --global dotnet-ef
Try removing the --global
parameter so that it updates the dotnet-tools.json file associated with the project.
dotnet tool update dotnet-ef
Upvotes: 6
Reputation: 1702
If you are using a command line ( CMD, Powershell, bash etc ) you can easily type the following to update into the latest version:
dotnet tool update --global dotnet-ef
If you want to update into a very specific version do the following:
dotnet tool update --global dotnet-ef --version VERSION_NUMBER
Example:
dotnet tool update --global dotnet-ef --version 3.1.0
Upvotes: 68
Reputation: 756
Update the tools using the package manager console:
Install-Package Microsoft.EntityFrameworkCore.Tools -Version 2.1.4
see this link https://www.nuget.org/packages/Microsoft.EntityFrameworkCore.Tools/
Upvotes: 74