如何添加自定义的NuGet喂TeamCity的构建? [英] How to add the custom nuget feed to TeamCity build?
问题描述
我创建使用TeamCity的一个的NuGet服务器(虚拟机在网络上运行),并创建数据包发布到它的构建。
I have created a Nuget Server using Teamcity (running on a virtual machine in internet) and created the build that publishes a package into it.
我也有另外一个项目需要使用该程序包。该项目是建立在TeamCity的为好。在我的本地的Visual Studio我加了的NuGet供稿URI,安装包,一切工作正常。但是,当我尝试建立它的TeamCity它说,包没有找到。
I also have another project that needs to use that package. This project is built on teamcity as well. On my local Visual Studio I added the nuget feed uri, installed the package and everything works fine. But when I try to build it on teamcity it says that "Package not found".
所以我的问题是:如何添加自定义的NuGet喂TeamCity的构建
So my question is : "How to add the custom nuget feed to TeamCity build?"
推荐答案
本的NuGet包源通过Visual Studio配置,但它们存储在每个用户的配置文件,发现在 C: \用户\ $ USER \应用程序数据\漫游\的NuGet \ NuGet.config
。需要为TeamCity的包源的条目被添加到正在运行的生成生成代理用户的配置文件。
The NuGet package sources are configured through Visual Studio, but they're stored in a per-user configuration file, found at c:\Users\$USER\AppData\Roaming\NuGet\NuGet.config
. The entry for the TeamCity package source needs to be added to the config file of the build agent user that's running your builds.
- 在您的本地计算机上,打开Nuget.config文件为您的用户
- 为TeamCity的包源的入口复制到剪贴板
- 在生成代理,打开NuGet.config文件,对正在执行的TeamCity的用户建立
- 在TeamCity的包源进入粘贴。储存并退出。
- 再次运行构建。现在应该是能够找到包。
编辑: ladenedge介绍了并不存在,当我最初回答了这个问题一个很好的解决方案。该解决方案是特别有用的,如果你没有管理员权限生成代理或希望在每个项目的基础配置包的来源。
ladenedge documents a good solution that didn't exist when I originally answered this question. The solution is especially useful if you don't have admin access to the build agent or want to configure package sources on a per-project basis.
这篇关于如何添加自定义的NuGet喂TeamCity的构建?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!