【发布时间】:2020-03-27 00:12:38
【问题描述】:
您好,我是 Azure Pipelines 的新手
我正在尝试使用自定义 Nuget Config 构建 Xamarin 应用程序,但在执行还原命令时构建失败。 我收到以下错误:
nuget 命令失败,退出代码 (1) 和错误(无法从远程源 'http://nuget.uxdivers.com/grial/FindPackagesById()?id='BCrypt.Net-PCL'&semVerLevel=2.0.0' 检索有关 'BCrypt.Net-PCL' 的信息。输入不是有效的 Base-64 字符串,因为它包含非 base 64 字符、两个以上的填充字符或填充字符中的非法字符。
包“BCrypt.Net-PCL”是一个 NuGet 包,但恢复命令正在“uxdrivers”源中查找它。 如果我在没有自定义 NuGet.config 的情况下运行,则还原可以找到所有 NuGet 包,但显然它找不到没有 NuGet 源,因此构建也会失败。
我尝试改变包源、凭据的顺序并尝试了不同的 vmImage,但我总是以这个错误告终。 请原谅我对这一点的无知,因为我是 YAML 和管道的新手。
提前感谢您的帮助!
请看下面我的 YAML:
- task: NuGetCommand@2
inputs:
command: 'restore'
restoreSolution: '**/*.sln'
feedsToUse: 'config'
nugetConfigPath: 'NuGet.config'
见下面我的 NuGet.config
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<clear />
<packageSources>
<add key="Grial" value="http://nuget.uxdivers.com/grial"/>
<add key="Syncfusion_Xamarin" value="https://nuget.syncfusion.com/nuget_xamarin/nuget/getsyncfusionpackages/xamarin"/>
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
</packageSources>
<packageSourceCredentials>
<Syncfusion_Xamarin>
<add key="Username" value="*MyUsername*" />
<add key="Password" value="*MyPassword*" />
</Syncfusion_Xamarin>
<Grial>
<add key="Username" value="*MyUsername*" />
<add key="Password" value="*MyPassword*" />
</Grial>
</packageSourceCredentials>
【问题讨论】:
标签: nuget yaml azure-pipelines