Mali Tbt
Mali Tbt

Reputation: 819

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

Upvotes: 47

Views: 19169

Answers (3)

Jey J
Jey J

Reputation: 202

It was still complaining and specifying the version worked for me:

dotnet tool update --global dotnet-ef --version x.x.x

Upvotes: 6

Roar S.
Roar S.

Reputation: 10679

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

Upvotes: 88

pinkfloydx33
pinkfloydx33

Reputation: 12739

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).

Upvotes: 5

Related Questions