简体   繁体   English

使用NuGet升级到特定的软件包版本

[英]Upgrade to a specific Package version with NuGet

How can I upgrade a NuGet package to a specific version. 如何将NuGet软件包升级到特定版本。

This is similar to Download old version of package with nuget , except I already have a version of the given nuget package installed. 这类似于使用nuget下载软件包的旧版本 ,除了我已经安装了给定nuget软件包的版本。

I can't update to the latest version, so I want to update to a specific one. 我无法更新到最新版本,因此我想更新到特定版本。

Do I need to uninstall and than re-install or can I upgrade in one step? 我需要卸载然后重新安装,还是可以一步升级?

So I think you need to run the Update-Package command by setting the Version flag. 因此,我认为您需要通过设置Version标志来运行Update-Package命令。

For example: 例如:

Update-Package Newtonsoft.Json -Version 6.0.4

Here's the full command from the documentation for more reference: 这是文档中的完整命令,以供更多参考:

Update-Package [-Id] [-IgnoreDependencies] [-ProjectName ] [-Version ] [-Source ] [-Safe] [-IncludePrerelease] [-Reinstall] [-FileConflictAction] [-WhatIf] 更新包[-Id] [-IgnoreDependencies] [-ProjectName] [-版本] [-源] [-安全] [-IncludePrerelease] [-重新安装] [-FileConflictAction] [-WhatIf]

http://docs.nuget.org/docs/reference/package-manager-console-powershell-reference http://docs.nuget.org/docs/reference/package-manager-console-powershell-reference

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM