Skip to main content

Fixed: "error NU1109: Detected package downgrade: Microsoft.EntityFrameworkCore.Relational from 10.0.12 to centrally defined 10.0.11"

· 5 min read
Jagdish Kumawat
Founder @ Dewiride

error NU1109: Detected package downgrade: Microsoft.EntityFrameworkCore.Relational from 10.0.12 to centrally defined 10.0.11. Update the centrally managed package version to a higher version. In a solution with Central Package Management and transitive pinning, the central file asked for an older version of a package than one of the dependencies needs. The two lines under the message show exactly who wants what.

What I Was Doing​

A .NET 10 solution manages its NuGet versions centrally in Directory.Packages.props, with transitive pinning switched on. That lets the central file set the version of Microsoft.EntityFrameworkCore.Relational, which no project references directly: it comes in through Oracle's MySql.EntityFrameworkCore 10.0.12 provider. The pin raised it from 10.0.12 to 10.0.14.

Then I changed the pin to 10.0.11:

Directory.Packages.props (the pin)
<PackageVersion Include="Microsoft.EntityFrameworkCore.Relational" Version="10.0.11" />
Terminal
dotnet restore

What I Expected​

A restore with Microsoft.EntityFrameworkCore.Relational at 10.0.11, the pinned version.

What I Got​

Output (the class library's lines, from dotnet restore src/Dewiride.Inventory.Data/Dewiride.Inventory.Data.csproj)
/Users/you/projects/dewiride-inventory-api/src/Dewiride.Inventory.Data/Dewiride.Inventory.Data.csproj : error NU1109: Detected package downgrade: Microsoft.EntityFrameworkCore.Relational from 10.0.12 to centrally defined 10.0.11. Update the centrally managed package version to a higher version.
/Users/you/projects/dewiride-inventory-api/src/Dewiride.Inventory.Data/Dewiride.Inventory.Data.csproj : error NU1109: Dewiride.Inventory.Data -> MySql.EntityFrameworkCore 10.0.12 -> Microsoft.EntityFrameworkCore.Relational (>= 10.0.12)
/Users/you/projects/dewiride-inventory-api/src/Dewiride.Inventory.Data/Dewiride.Inventory.Data.csproj : error NU1109: Dewiride.Inventory.Data -> Microsoft.EntityFrameworkCore.Relational (>= 10.0.11)

A terminal where dotnet restore fails with error NU1109: Detected package downgrade: Microsoft.EntityFrameworkCore.Relational from 10.0.12 to centrally defined 10.0.11, with the dependency path through MySql.EntityFrameworkCore 10.0.12 and the pinned version below it.

Restoring the whole solution failed the same way for the web API, which references the class library: two errors in all. The lines above come from restoring the class library on its own, which prints each message on one line.

What I Checked​

The two dependency lines. They're the two requests NuGet couldn't satisfy together:

  • Dewiride.Inventory.Data -> MySql.EntityFrameworkCore 10.0.12 -> Microsoft.EntityFrameworkCore.Relational (>= 10.0.12): the provider needs 10.0.12 or later.
  • Dewiride.Inventory.Data -> Microsoft.EntityFrameworkCore.Relational (>= 10.0.11): the pin, which acts like a direct reference to 10.0.11.

Why NuGet refuses instead of picking 10.0.12. Microsoft's NU1109 page explains: "When resolving packages, NuGet respects the direct-dependency-wins rule and the pinned package version overrides the version specified by the dependency package which results in a lower version of the package being resolved which could result in issues at runtime." The pinned version would win, and the provider would get an older EF Core than it was built for. NuGet stops the restore instead.

Why It Happens​

The pin acts like a direct reference to 10.0.11, while the provider needs 10.0.12 or later. Honouring the pin would resolve a version below the provider's minimum, and the NuGet docs rule that out: "downgrades are not allowed when transitive pinning a package." So restore stops with NU1109 instead of choosing either version.

The Fix​

The NU1109 page gives two solutions:

  1. "Update the PackageVersion of PackageB to the higher version of the package."
  2. "Disable Central Package Management transitive pinning to allow the package version specified by the dependency package to be used."

The pin existed to raise EF Core to its newest patch, so the first is the fix: set it back to a version at or above the provider's minimum.

Directory.Packages.props (the pin)
<PackageVersion Include="Microsoft.EntityFrameworkCore.Relational" Version="10.0.14" />

The second would also clear the error, but it turns off every pin in the solution, and EF Core would fall back to 10.0.12, the provider's minimum.

After the Fix​

Terminal
dotnet restore
Output
Restore complete (1.0s)

Build succeeded in 1.1s

A terminal where dotnet restore completes and reports Build succeeded after the pinned version was raised to 10.0.14.

Common Mistakes​

MistakeWhat happensDo this instead
Pinning to the version you see in dotnet package list without checking what's requiredA pin below a dependency's minimum fails with NU1109Read the (>= …) in the dependency's requirement
Turning off transitive pinning to clear the errorAll pins stop workingRaise the one pin that's too low
Copying a pin from another solutionIts dependencies may need a different minimumCheck dotnet package list --include-transitive in this solution

Troubleshooting​

SymptomLikely causeFix
NU1109: Detected package downgrade: … to centrally defined …A central pin is below what a dependency needsRaise the PackageVersion to at least the version after >=
The error names a package none of your projects referencesTransitive pinning applies the central version to dependencies tooRaise that pin
A solution restore reports the error for several projectsEach project that uses the dependency is affectedOne change in Directory.Packages.props fixes them all

FAQ​

How is NU1109 different from NU1605?​

Both report a "Detected package downgrade". NU1109 is the Central Package Management case, where the lower version comes from Directory.Packages.props. Without central management, the same situation from a project's own PackageReference is reported as NU1605.

Does NU1109 mean my package is broken?​

No. Nothing was installed: restore stopped before using the lower version.

Conclusion​

NU1109 means a version in Directory.Packages.props pins a package below what one of your dependencies requires. The two lines under the message show both requests: the dependency's (>= …) and your pin. Raise the pin to at least that version, here 10.0.14 against the provider's 10.0.12, and restore succeeds.

Additional Resources​

Stay Updated

Subscribe to our newsletter for the latest tutorials, tech insights, and developer news.

By subscribing, you agree to our privacy policy. Unsubscribe at any time.