[Bug]: CPVM: Directory.Packages.props Imports aren't being respected #11560
Labels
Area:RestoreCPM
Central package management
Functionality:Restore
Resolution:Duplicate
This issue appears to be a Duplicate of another issue
Type:Bug
NuGet Product Used
dotnet.exe, MSBuild.exe
Product Version
dotnet 6.0.1, nuget 6.0.0.280, msbuild 16.11.1+3e40a09f8
Worked before?
No response
Impact
It's more difficult to complete my work
Repro Steps & Context
I have an existing code base that used a combination of
Directory.Build.targets
files to achieve a pre-cursor to what CPVM does.The main repo folder has one such file with a bunch of
<PackageReference Update="A" Version="1.0.0" />
directives and each solution/project that needs to specialize/override anything has their own copy with an import directive to the baseline file, i.e.<Import Project="../Directory.Build.targets" />
.When migrating that codebase to use CPVM, I followed the same pattern with the
Directory.Packages.props
files, assuming theImport
will apply in the same order and behavior.This seems to not be the case, As the baseline version of a package "wins" over the nearest version defined in an inner
props
file.I've made a simple repro to showcase the issue with Newtonsoft.Json v12 and v13, Where i try to use a type that only exists in the latter in one project.
Expected: The build completes successfully, Meaning the project with the specific
Directory.Packages.props
with v13 was applied properly.Actual: The build failes on the missing type, Meaning the baseline v12 was applied.
Steps to repro:
dotnet build
Import
directive fromConsole\Directory.Packages.props
I know there is an open issue on version overriding specifically for CPVM, But i didn't feel this comes from the same source.
There is an
msbuild.log
file in the repro that is the output ofdotnet build
in my case as an example.Verbose Logs
No response
The text was updated successfully, but these errors were encountered: