Douglas Woods
Douglas Woods

Reputation: 964

How do you override a transitive nuget dependency

I have a net6.0 project where one of the packages has a transitive dependency on another package that has a vulnerability.

I also explicity have added the latest version of the package with the vulnerability. Is there a way I can override the transitive dependency with the updated version?

Upvotes: 10

Views: 7513

Answers (1)

rbennett485
rbennett485

Reputation: 2163

Sounds like you've already done it - you can only use one version of each package, which NuGet picks at restore time.

If you've got a direct reference to the newer version then that is the version that will get picked due to the nearest wins rule.

Upvotes: 10

Related Questions