TeamCity Nuget安装构建步骤不使用多个源,其中一个是TC的私有NuGet源

mar*_*are 9 teamcity nuget teamcity-7.1

在将源设置为TeamCity的NuGet服务器时,我在NuGet Install构建步骤中收到以下错误:

Step 1/4: NuGet install (NuGet Installer) (3s)

[15:11:19][Step 1/4] scan: Searching for nuget.config files

[15:11:19][Step 1/4] install: Installing NuGet packages for packages.config (3s)

[15:11:19][install] NuGet command: C:\TeamCity\buildAgent\tools\NuGet.CommandLine.2.2.0.nupkg\tools\NuGet.exe install C:\TeamCity\buildAgent\work\a4b9de5be22a981\packages.config -OutputDirectory C:\TeamCity\buildAgent\work\a4b9de5be22a981\packages -Source http://localhost:9090/guestAuth/app/nuget/v1/FeedService.svc

[15:11:19][install] Starting: C:\TeamCity\buildAgent\temp\agentTmp\custom_script96367186180319830.cmd

[15:11:19][install] in directory: C:\TeamCity\buildAgent\work\a4b9de5be22a981

[15:11:22][install] The remote server returned an error: (404) Not Found.

[15:11:22][install] Process exited with code 1

[15:11:22][Step 1/4] Step NuGet install (NuGet Installer) failed
Run Code Online (Sandbox Code Playgroud)

如果我将源字段留空,它将从默认提要(NuGet社区提要)中找到NuGet包,但不会在TC的NuGet提要中找到本地构建和打包并托管的包.

如何在NuGet安装程序构建步骤中同时使用默认提要和内部TC的NuGet提要?

Ale*_*ček 16

您可以仅通过nuget.config文件为解决方案指定自定义Feed .

关键点是提供这样的凭证部分packageSourceCredentials:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <packageSources>
    <add key="Local" value="http://localhost:9090/httpAuth/app/nuget/v1/FeedService.svc" />
  </packageSources>
  <activePackageSource>
    <add key="Local" value="http://localhost:9090/httpAuth/app/nuget/v1/FeedService.svc" />
  </activePackageSource>
  <packageSourceCredentials>
    <Local>
      <Username>login</Username>
      <Password>pa$$w0rd</Password>
    </Local>
  </packageSourceCredentials>
</configuration>
Run Code Online (Sandbox Code Playgroud)

config文件应sln位于存储库中的文件旁边.