我放置了包配置 and nuget.config到我的根文件夹。
当我跑步时努吉特恢复在我的开发机器上,包被恢复到根/包文件夹,如 nuget.config 中所述。
但是,当我将 Nuget Installer 构建步骤添加到 TFS2015 构建定义时,包将恢复到 ../Nuget/Packages,它位于我的根文件夹之外。我在接下来的构建步骤中引用恢复的 nuget 包时遇到问题。
- 为什么 nuget 恢复在构建服务器上的行为不同?
- 如何修复它?
nuget.config:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<config>
<add key="repositoryPath" value="Packages" />
</config>
<packageRestore>
<add key="enabled" value="True" />
<add key="automatic" value="True" />
</packageRestore>
<packageSourceCredentials />
</configuration>
来自 NuGet 恢复构建步骤的日志:
Set workingFolder to default: C:\Builds\Agent\tasks\NuGetInstaller\0.1.18
Executing the powershell script: C:\Builds\Agent\tasks\NuGetInstaller\0.1.18\NuGetInstaller.ps1
Saving to C:\Windows\Agent\_work\2\NuGet\newNuGet.config
C:\Builds\Agent\agent\worker\tools\NuGet.exe restore "C:\Windows\Agent\_work\2\s\packages.config" -NonInteractive -configfile "C:\Windows\Agent\_work\2\NuGet\newNuGet.config"
MSBuild auto-detection: using msbuild version '14.0' from 'C:\Program Files (x86)\MSBuild\14.0\bin'.
All packages listed in packages.config are already installed.
您也可以从命令行覆盖软件包目录,这可能会更容易,因为您可以使用构建中的预定义变量传递值:
Nuget Arguments: -PackagesDirectory "$(Build.SourcesDirectory)\Packages"
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)