44
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

3 Answers 3

80

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

17
  • After runnign this, I get this error - .dotnet/tools is int $PATH: The term 'Update-Database' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again
    – Mali Tbt
    Commented Aug 18, 2020 at 12:14
  • Please have a look at this question and see comment with 11 upvotes right below the question: stackoverflow.com/questions/9674983/… He says: Simply exit and restart VS (or unload/reload the project)
    – Roar S.
    Commented Aug 18, 2020 at 12:16
  • I saw that and applied the solution they sugested. Including rebooting my machine but the same issue. I have entityframework core, design,sqlserver 3.1.7. My points are too low to comment on that question to discuss my issue.
    – Mali Tbt
    Commented Aug 18, 2020 at 12:29
  • Which version of Visual Studio are you using? Several solutions in this thread: stackoverflow.com/questions/40810258/… I guess a Nuget update to latest version of EntityFramework is the most likely one
    – Roar S.
    Commented Aug 18, 2020 at 12:31
  • Thanks. And what version of Nuget EntityFrameworkCore are you using?
    – Roar S.
    Commented Aug 18, 2020 at 13:01
6

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

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

1
  • Thanks, this was the one that did the trick for me (from 7.0.8 to 7.0.13)!
    – maets
    Commented Nov 10, 2023 at 8:22
4

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.