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
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?
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
The latest major version of the EF tools is 10 which seems to require .NET 10 SDK:

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

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