简体   繁体   English

有没有一种方法可以在构建时自动安装特定版本的Nuget软件包?

[英]Is there a way to automatically install a specific version of a Nuget Package at build time?

I have some 3rd party DLL's i need migrating into a TFS Nuget Feed, and I haven't been able to find many articles on the internet about installing specific versions of a given Nuget Package at runtime, could anybody link me to some relevant material and/or provide some pointers to this effect? 我有一些第三方DLL,我需要迁移到TFS Nuget Feed中,但我在网上找不到很多有关在运行时安装给定Nuget Package特定版本的文章,有人可以将我链接到一些相关材料并/或提供一些指向这种效果的指针?

Ideally this would be done as an MSBuild Target I think? 理想情况下,这会作为我认为的MSBuild目标完成?

Thanks in Advance :) 提前致谢 :)

To promote a cleaner development environment and to reduce repository size, NuGet Package Restore installs all referenced packages before a project is built. 为了促进更清洁的开发环境并减小存储库的大小,NuGet软件包还原会在构建项目之前安装所有引用的软件包。 This widely-used feature ensures that all dependencies are available in a project without requiring those packages to be stored in source control (see Packages and Source Control on how to configure your repository to exclude package binaries). 此广泛使用的功能可确保项目中所有依赖项均可用,而无需将那些程序包存储在源代码管理中(有关如何配置存储库以排除程序包二进制文件,请参阅程序包和源代码管理)。

This should help NuGet Package Restore 这应该有助于NuGet软件包还原

One of the topics 主题之一

MSBuild-integrated restore in Visual Studio, for NuGet 2.6 and earlier. 适用于NuGet 2.6和更早版本的Visual Studio中与MSBuild集成的还原。

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

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