NuGet安装旧版本程序包的方法
2018-03-01 14:40
357 查看
首先打开程序包管理器控制台:工具→Nuget程序包管理器→程序包管理器控制台
打开如下图所示的命令行界面
安装指定版本的Package
NuGet默认只能安装最新版本程序包,如果需要旧版本程序包,只能通过程序包管理控制台来安装:
常用命令
复制内容到剪贴板程序代码Install-Package PackageName [-Version <string>] [-IgnoreDependencies]
Uninstall-Package PackageName [-RemoveDependencies]
打开如下图所示的命令行界面
安装指定版本的Package
PM> Install-Package BenchMarkdotnet -version 0.9.7更新到指定版本的Package
PM> Update-Package BenchMarkdotnet -version 0.9.7
Update-Package命令相关参数说明:
Parameter | Type | Description |
---|---|---|
-Id | string | Specifies the Id of the package to be updated. |
-ProjectName | string | Specifies the name of the project in which packages should be updated. |
-Version | SemanticVersion* | Specifies the new target version of the package as a result of the update. |
-Source | string | Specifies where to look for package updates, overriding the package sources that are specified in the Options dialog. This value can be either a url to a remote repository or a path to a local repository or the name of a package source specified in the Options dialog. |
-IgnoreDependencies | Switch parameter | If set, NuGet will ignore dependency packages and only update the main package. |
-Safe | Switch parameter | If set, NuGet will only update to a new version that has the same major and minor versions as the previous package. For example, if the old version is 1.2.0, NuGet will accept the update package with version of 1.2.1 or 1.2.9999 but it will not accept 1.3.0. |
-IncludePrerelease | Switch parameter | If set, NuGet will consider prerelease packages as candidates for updates. |
-Reinstall | Switch parameter | If set, instead of updating the package to the latest version, NuGet will uninstall the package and reinstall the same version. This is useful when, for example, you've updated the target framework of your project, e.g. from .NET 4.0 to .NET 4.5, and you want to reference .NET 4.5-specific assemblies in the package. You can't set this parameter together with |
NuGet默认只能安装最新版本程序包,如果需要旧版本程序包,只能通过程序包管理控制台来安装:
常用命令
复制内容到剪贴板程序代码Install-Package PackageName [-Version <string>] [-IgnoreDependencies]
Uninstall-Package PackageName [-RemoveDependencies]
相关文章推荐
- 安装旧版本NuGet程序包到项目的方法
- Gearman分布式任务处理系统(五)版本介绍、安装方法和使用说明
- SUSE各个系统版本安装saltstack方法
- TurboShop4.0版本安装方法
- IIS上安装PHP5.3的完整教程方法(及5.3.0以后版本的方法)
- php5.3 和之后的版本在 win2003 iis6 中的安装方法
- 安装flashplayer 提示 "您尝试安装的 Adobe Flash Player" 版本不是最新版本. 请访问 Player 下载中心 获取最新、最安全版本"的解决方法
- 基于Fedora14下自带jdk1.6版本 安装jdk1.7不识别的解决方法
- 所有版本的 QT 编译安装方法
- 安装最新MSN8.5时候出现上述提示 “需要安装 Windows Update Agent 5.8.02469或更高版本"的解决方法
- delphi2007控件安装多版本可以用多用户方法来解决
- Win10下python3和python2同时安装并解决pip共存问题 特别说明,本文是在Windows64位系统下进行的,32位系统请下载相应版本的安装包,安装方法类似。 使用python开
- 各版本IIS安装方法
- [VS2008] Debug版本程序发布后 由于应用程序的配置不正确,应用程序未能启动,重新安装应用程序可能会纠正这个问题 解决方法
- xhprof安装和使用方法(linux版本)
- wdcp安装多版本php环境报错的解决方法
- VS2010从nuget 安装Unity出现错误的解决方法 无法安装程序包“Unity 4.0.1”
- “Qt没有被正确安装,请运行make install““无效的Qt版本”的解决方法
- Linux下安装MariaDB数据库问题及解决方法(二进制版本的安装)
- “Qt没有被正确安装, 请运行make install” “无效的Qt版本”的解决方法