[英]How do I update a single nuget package in a project from the command line?
I am trying to update a single package in a csproj with multiple dependencies. 我正在尝试使用多个依赖项更新csproj中的单个包。 That is, the packages.config file looks like this: 也就是说,packages.config文件如下所示:
<packages>
<package id="PackageA" version="1.2.1" targetFramework="net40" />
<package id="PackageB" version="2.3.4" targetFramework="net40" />
<package id="PackageC" version="1.0.0" targetFramework="net40" />
</packages>
I'd like to update PackageA without updating the others. 我想更新PackageA而不更新其他的。 I see that Update-Package in the Visual Studio package manager has this capability , but this needs to run on a TFS build machine. 我看到Visual Studio包管理器中的Update-Package具有此功能 ,但这需要在TFS构建计算机上运行。
Is there a way to do this from the command line? 有没有办法从命令行执行此操作? The anticipated workflow is the build machine running 预期的工作流程是构建机器运行
But the update command does not allow us to specify which package to update on. 但是update命令不允许我们指定要更新的包。 I know there is an allowedVersions tag for the packages, but that is would require us to change the packages.config file when creating different branches that require different components to update or not, whereas a package-specific, csproj-specific command-line would allow us to associate the dependencies to update with each TFS branch via its build definitions. 我知道包有一个allowedVersions标记,但是这需要我们在创建需要不同组件来更新的不同分支时更改packages.config文件,而特定于包的,特定于csproj的命令行会允许我们通过其构建定义将依赖关系与每个TFS分支相关联。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.