I'm working on a large solution of various projects. For infrastructure-related reasons, versions of directly or indirectly referenced NuGet packages must be the same across all projects.
Is there any reasonably easy way to ensure version consistency of indirect NuGet dependencies between projects?
Things I have considered so far:
- Microsoft.Build.CentralPackageVersions. I would like to avoid this, as it's too much of a structural change for the solution
- Directory.Packages.Props. Would like to avoid as well as not mature enough yet.
- Directory.Build.Targets with PackageReference Update. This seemed to update directly referenced packages, but seemed to have no effect on indirect dependencies. (Should it? Could this be my mistake?)
- Adding direct references to all projects for all conflicting indirect packages. This would probably solve it, but seems massively ugly (lots of work, and extremely hard to track & update in the future)
Is there any better way of doing things?