How to uninstall specific version of a NuGet packa

2019-06-21 19:14发布

问题:

I somehow have two versions of the same NuGet package in one of my projects.

Is there a way to uninstall a specific version of that package?

I've tried Uninstall-Package [name] and then Install-Package [name], although this seems to keep both versions.

This is causing issues in my code where references to classes in that package are being treated as ambiguous, and cause build errors.

回答1:

Uninstall-Package Microsoft.Azure.ServiceBus -version 3.0.1.16 -force



回答2:

You need to specify the version as well like

Uninstall-Package package_name -version specific_version