Joe
Joe

Reputation: 6806

Migrating Nuget from packages.config to PackageReference - transitive dependencies are reversed

I am about to migrate a C# class library from using packages.config format to PackageReference format. However the migration dialog seems to have inverted dependencies of two of my packages and I'm not sure what to do (or if I am misinterpreting it)

Specifically, my project makes use of the Prism.Wpf package version 6.3. That depends upon the package Prism.Core (7.x). Yet when I look at the migration dialog it lists Prism.Core as a "Top-level" dependency and Prism.Wpf as "Transitive". Looks like this:

enter image description here

  1. This is backwards, isn't it? If Prism.Wpf depends on Prism.Core, then I would expect to see Prism.Wpf as the top level and Prism.Core as the transitive dependency.
  2. If I am correct and it is backwards, would anyone know what is the best approach to fix this so I can migrate with minimal headaches? Should I just click the checkbox to mark Prism.Wpf as top level, do the migration, and hope it reverses up the dependency? Would I then need to go in an muck around the .csproj file to somehow fix that dependency myself? Or should I just remove and re-add the packages? Something else?

Upvotes: 0

Views: 1260

Answers (1)

imps
imps

Reputation: 1661

Prism.Unity 6.3.0 references Prism.Wpf 6.3.0, that's why Prism.Wpf is not top level. Prism.Core 7.0.0.396 is not directly referenced by Prism.Wpf 6.3.0. Prism.Wpf 6.3.0 references Prism.Core 6.3.0.

It's very likely that you have updated Prism.Core 7.0.0.396 manually yourself.

If NuGet prunes Prism.Core, then because of the dependency resolution rules, it will resolve to 6.3.0 which would break your dependency graph.

Upvotes: 1

Related Questions