Skip to content

dotnet-ef installation fails since 8.0 release #36904

Open

Description

Describe the bug

Running dotnet tool install dotnet-ef on a system which does not have the .NET 8.0 SDK installed, the installation fails with:

error NU1202: Package dotnet-ef 8.0.0 is not compatible with net7.0 (.NETCoreApp,Version=v7.0) / any. Package dotnet-ef 8.0.0 supports: net8.0 (.NETCoreApp,Version=v8.0) / any

While this makes somewhat sense, I'm wondering whether this is intended behaviour? We have a lot of pipelines running the above command to generate EF migration bundles, and the .NET 8.0 release effectively broke all of these pipelines.
I'm also quite sure that we didn't have this problem last year when .NET 7.0 was released.
Since azure devops hosted build agents have apparently not yet been upgraded to .NET 8.0 (which was also the case in the first months 7.0 was released), this fails.

I'm aware this can be fixed by either installing the 8.0 SDK in a previous step in the build pipeline, or by specifying the dotnet-ef version (e.g. dotnet tool install dotnet-ef --version 7.0.14), but both of those solutions would require modifying all existing pipelines, and mantaining either of those versions going forward.

Isn't the .NET SDK supposed to figure out whichever tool release is compatible with my local SDK version, and install that release instead of mindless attempting to install whichever latest version is published?

To Reproduce

  1. Start from a clean system
  2. Install the .NET 7.0 SDK
  3. Run dotnet tool install dotnet-ef
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions