| title | NuGet Error NU1109 | |
|---|---|---|
| description | NU1109 error code | |
| author | nkolev92 | |
| ms.author | nikolev | |
| ms.date | 11/07/2022 | |
| ms.topic | reference | |
| f1_keywords |
|
NU1109: Detected package downgrade: PackageB from 2.0.0 to centrally defined 1.0.0. Update the centrally managed package version to a higher version.
'Project' -> 'PackageA' 1.0.0 -> 'PackageB' (>= 2.0.0)
'Project' -> 'PackageB' (>= 1.0.0)
A project is configured to use NuGet Central Package Management and a transitive package dependency is pinned to a version lower than is specified by the dependency package. 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.
<PropertyGroup>
<CentralPackageTransitivePinningEnabled>true</CentralPackageTransitivePinningEnabled>
</PropertyGroup>
<ItemGroup>
<PackageVersion Include="PackageA" Version="1.0.0" />
<PackageVersion Include="PackageB" Version="1.0.0" />
</ItemGroup>- Update the
PackageVersionofPackageBto the higher version of the package.
<ItemGroup>
<PackageVersion Include="PackageB" Version="2.0.0" />
</ItemGroup>- Disable Central Package Management transitive pinning to allow the package version specified by the dependency package to be used.
<PropertyGroup>
<CentralPackageTransitivePinningEnabled>false</CentralPackageTransitivePinningEnabled>
</PropertyGroup>