Skip to content

Add Microsoft.EntityFrameworkCore.Design package to Boilerplate to prevent fallback to 8.x version on EF Core 10 projects #12333

@yasmoradi

Description

@yasmoradi

Problem

Microsoft.EntityFrameworkCore.Design is not explicitly referenced in the Boilerplate project files. When running EF Core CLI commands (e.g., dotnet ef migrations add), NuGet may fall back to resolving an older 8.x.x version of the Design package instead of the 10.x.x version being used by the rest of the project. This can cause compatibility issues in an EF Core 10-powered project.

Solution

Explicitly add Microsoft.EntityFrameworkCore.Design (with PrivateAssets="all" so it doesn't leak as a transitive dependency) to:

  1. Directory.Packages.props — add <PackageVersion Include="Microsoft.EntityFrameworkCore.Design" Version="10.0.x" /> to pin the version centrally.
  2. Boilerplate.Server.Api.csproj — add <PackageReference Include="Microsoft.EntityFrameworkCore.Design" PrivateAssets="all" />.
  3. Boilerplate.Server.Web.csproj — add <PackageReference Condition=" '$(offlineDb)' == 'true' OR '$(offlineDb)' == ''" Include="Microsoft.EntityFrameworkCore.Design" PrivateAssets="all" /> (conditional, same as Tools).

Files to change

  • src/Templates/Boilerplate/Bit.Boilerplate/src/Directory.Packages.props
  • src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Boilerplate.Server.Api.csproj
  • src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Web/Boilerplate.Server.Web.csproj

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions