TFS2012 构建服务器未从内部存储库还原 NuGet 包 [英] TFS2012 build server not restoring NuGet packages from in-house repository

查看:20
本文介绍了TFS2012 构建服务器未从内部存储库还原 NuGet 包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经设置了一个内部 NuGet 存储库(我们其中一台服务器上的共享文件夹),并将其添加到我 PC 上 Visual Studio NuGet 设置中的可用源"列表中.我能够从这个存储库成功地将一个包安装到我的解决方案中.

I've set up an in-house NuGet repository (a shared folder on one of our servers), and have added it to the "Available Sources" list in the Visual Studio NuGet settings on my PC. I'm able to successfully install a package into my solution from this repository.

但是在 TFS 服务器上构建失败,因为它无法恢复这个特定的包(消息:无法找到包 'xxx' 的版本 'xxx'").该解决方案配置为启用 NuGet 包还原",这对于通过 nuget.org 安装的包非常有效.它只是没有从我们的内部存储库中恢复包.

However on the TFS server the build is failing because it can't restore this particular package (message: "Unable to find version 'xxx' of package 'xxx'"). The solution is configured for "enable NuGet package restore", which works fine for packages installed via nuget.org. It's just not restoring the package from our internal repository.

存储库文件夹/共享的权限很好.我错过了什么?

Permissions on the repository folder/share are fine. What am I missing?

我猜我也必须在 TFS 服务器上配置 Visual Studio 的可用源",但大概这些设置是用户特定的?构建服务作为 NETWORK SERVICE 运行,那么如何为该用户配置 NuGet?

I'm guessing I have to configure Visual Studio's "available sources" on the TFS server too, but presumably these settings are user-specific? The build service runs as NETWORK SERVICE, so how can I configure NuGet for this user?

推荐答案

更改您的构建以作为特定帐户运行.然后,您可以使用该帐户登录并证明所有这些小问题.

change your build to run as a specific account. you can then logon with that account and prove off all of these little snags.

根据您执行 NuGet 还原的方式,您是否使用本地提要的位置更新了目标文件?

depending on which way you are doing the NuGet restore, have you updated the targets file with the location of your local feed?

<ItemGroup Condition=" '$(PackageSources)' == '' ">
        <!-- Package sources used to restore packages. By default, registered sources under %APPDATA%NuGetNuGet.Config will be used -->
        <!-- The official NuGet package source (https://www.nuget.org/api/v2/) will be excluded if package sources are specified and it does not appear in the list -->
        <!--
            <PackageSource Include="https://www.nuget.org/api/v2/" />
            <PackageSource Include="https://my-nuget-source/nuget/" />
        -->
      <PackageSource Include="http://MyLocalFeed/nuget/nuget"/>

    </ItemGroup>

这篇关于TFS2012 构建服务器未从内部存储库还原 NuGet 包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆