How do you override a transitive nuget dependency

Viewed 622

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?

1 Answers

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.

Related