Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The EF Core tools version '3.1.2' is older than that of the runtime '3.1.7'. Update the tools for the latest features and bug fixes

PM> update-database
Build started...
Build succeeded.
The EF Core tools version '3.1.2' is older than that of the runtime '3.1.7'. Update the tools for the latest features and bug fixes.

I tried a local update. As different projects might use different versions on the same machine.

If I do this

$ dotnet tool update dotnet-ef

I get this error Cannot find a manifest file.

This is my version number:

$ dotnet ef --version
Entity Framework Core .NET Command-line Tools
3.1.5
like image 981
Mali Tbt Avatar asked Aug 16 '20 19:08

Mali Tbt


People also ask

How do I update EF core tools?

Update the toolsUse dotnet tool update --global dotnet-ef to update the global tools to the latest available version. If you have the tools installed locally in your project use dotnet tool update dotnet-ef . Install a specific version by appending --version <VERSION> to your command.

How do I update my EF core model after database change?

Right-click anywhere on the design surface, and select Update Model from Database... In the Update Wizard, select the Refresh tab and select your table then click Finish button.

What is the latest version of EF core?

The most recent Entity Framework Core 6.0 (EF Core 6) was released on 10 November 2021.


2 Answers

UPDATE This turned out to be an issue with a lot of facets. Main problem was Visual Studio: https://developercommunity.visualstudio.com/content/problem/438312/vs-2019-preview2-after-saving-edmx-code-is-not-gen.html


Please try

dotnet tool update --global dotnet-ef

and restart Visual Studio

like image 191
Roar S. Avatar answered Oct 23 '22 12:10

Roar S.


There should be no harm using the newer tool with older versions of EF. You'll get bug fixes and features to the tool that should all be backwards compatible. Unless you are using different major versions (2.x vs 3.x) I think in this instance that --global is the right way to install/update the tool.

Otherwise you need to have a .config/dotnet-tools.json file in your project (or a directory above it somewhere). This is the manifest file that the error says is missing. You can create a new one with dotnet new tool-manifest but then you'll have to edit it yourself:

{
    "version": "1",
    "isRoot": true,
    "tools": {
        "dotnet-ef": {
            "version": "3.1.7",
            "commands": ["dotnet-ef"],
        }
    }
}

Once you've done that you need to run dotnet tool restore to restore and install the tool locally. More info on the manifest file can be found here. For dotnet-ef specifically, see here.

I'm not certain, but fairly positive that if you attempt to install the tool locally it should create the manifest and add the necessary info if it doesn't already exist. You might just need to try running dotnet tool install dotnet-ef within the project directory (and not update).

like image 4
pinkfloydx33 Avatar answered Oct 23 '22 10:10

pinkfloydx33