2

If my Project A has a reference to a package like NLog 2.0 and Project B, and if Project B also has a reference to NLog 1.0, then at runtime, when Project A executes Project B's functionality, will it use NLog 1.0 or NLog 2.0?

If I upgrade NLog to version 3.0 in Project B, it generates some config settings like dependentAssembly, bindingRedirection in app.config. Should I manually add those entries in Project A's app.config too?

Please help me to understand it.

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
YMK
  • 31
  • 2

1 Answers1

2

Dependency resolution is done with either

    1. PackageReference or
    1. packages.config

the first is newer and preferred and default in new projects, you should consider to change to it!

then the answer is clear:

"Direct dependency wins"

https://learn.microsoft.com/en-us/nuget/concepts/dependency-resolution

Falco Alexander
  • 3,092
  • 2
  • 20
  • 39