我正在为我的项目创建build.xml。
在这个build.xml中有一个像这样的Nuget目标
<Target Name="Nuget">
<!-- Gets the nuget version -->
<Exec Command="$(Nuget-ToolPath)NuGet.exe help |findstr/n ^^|findstr "^[1]: ^[0]:""/>
<Exec Command="$(Nuget-ToolPath)NuGet.exe config -set repositoryPath=$(PackagesPath) -configfile $(Nuget-ToolPath)NuGet.Config"/>
<Exec Command="$(Nuget-ToolPath)NuGet.exe restore %(Nuget-PackageConfig.Identity) -PackagesDirectory $(PackagesPath) -Verbosity detailed"/>
</Target>
我可以在输出上看到所有路径都正确。
但是
在使用的nuget配置文件输出中,我发现我的自定义nuget.config没有被使用。
NuGet Config files used:
C:\Users\XXXX\AppData\Roaming\NuGet\NuGet.Config
C:\Program Files (x86)\NuGet\Config\Microsoft.VisualStudio.Offline.config
我的项目Nuget.config在使用的NuGet配置文件列表中缺失。
这导致我的持续集成服务器出现问题,因为我自己的nuget存储库的配置没有被使用。
我的nuget版本是4.6.2.5055
我的nuget配置文件看起来像这样
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<solution>
<add key="disableSourceControlIntegration" value="true" />
</solution>
<packageRestore>
<add key="enabled" value="True" />
<add key="automatic" value="True" />
</packageRestore>
<packageSources>
<add key="private-repo" value="https://proget.xpto.com/my-nugets" />
</packageSources>
<activePackageSource>
<add key="All" value="(Aggregate source)" />
</activePackageSource>