Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

installing dotnet-ef dotnet tool throws error

I’m trying to install the Entity Framework Core CLI tools globally using the .NET CLI command:

dotnet tool install --global dotnet-ef

However, the installation fails with the following error message:

Tool 'dotnet-ef' failed to update due to the following:

The settings file in the tool's NuGet package is invalid: Settings file 'DotnetToolSettings.xml' was not found in the package.
Tool 'dotnet-ef' failed to install. Contact the tool author for assistance.

To reproduce, run dotnet tool install --global dotnet-ef in a terminal or command prompt.

What I've tried

  • Running dotnet tool uninstall --global dotnet-ef and reinstalling.

Why is this error occurring, and how can I fix it so that dotnet-ef installs successfully?

like image 976
tutte2k Avatar asked Dec 28 '25 16:12

tutte2k


2 Answers

This is due to a mismatch between the version of the .NET SDK (probably v9.0) and the latest version of the dotnet-ef tool (v10.0). This command tells you which versions you have installed:

dotnet --list-sdks

You can solve it by explicitely specifying a version of the tool that matches your installed .NET SDK. For example, when running on .NET SDK v9.0:

install --global dotnet-ef --version 9.0.11

or

dotnet.exe tool install --global dotnet-ef --version 9.0.11
like image 162
tutte2k Avatar answered Dec 31 '25 07:12

tutte2k


The latest major version of the EF tools is 10 which seems to require .NET 10 SDK:

enter image description here

So you need either to install earlier version (as you discovered):

dotnet tool install --global dotnet-ef --version 9.0.11

Or use newer SDK (note you can use .NET 10 SDK to build .NET 9 projects, though there can be some nuances):

enter image description here

like image 29
Guru Stron Avatar answered Dec 31 '25 05:12

Guru Stron



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!