使用 NuGet 下载旧版本的包 [英] Download old version of package with NuGet
问题描述
有没有办法使用 NuGet 下载先前版本的软件包,而不是最新版本?
Is there a way to download a previous version of a package with NuGet, not the latest one?
推荐答案
在 Visual Studio 中打开包管理器控制台 - 它位于工具/NuGet 包管理器/包管理器控制台中.然后运行 Install-Package 命令:
Bring up the Package Manager Console in Visual Studio - it's in Tools / NuGet Package Manager / Package Manager Console. Then run the Install-Package command:
Install-Package Common.Logging -Version 1.2.0
有关详细信息,请参阅命令参考.
See the command reference for details.
为了列出包的版本,您可以使用带有 远程参数和 过滤器的 Get-Package 命令:
In order to list versions of a package you can use the Get-Package command with the remote argument and a filter:
Get-Package -ListAvailable -Filter Common.Logging -AllVersions
通过在 Install-Package
命令中的版本选项后面按 Tab 键,您可以获得最新可用版本的列表.
By pressing tab after the version option in the Install-Package
command, you get a list of the latest available versions.
这篇关于使用 NuGet 下载旧版本的包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!