嗨,我是Azure Pipelines的新手
我正在尝试使用自定义的Nuget Config构建Xamarin应用程序,但是当我进入restore命令时,构建失败。 我收到以下错误:
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软件包,但restore命令正在“ 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>
答案 0 :(得分:0)
Azure Pipelines NuGet.config软件包还原失败
在Nuget.Config
文件中配置的方式似乎存在语法错误。
如果存在加密密码,则该密码将无法在其他计算机上使用,因为它是使用开发计算机上存储的密钥进行编码的。您可以将其替换为明文密码,例如:
<add key="Username" value="%USER_VARIABLE%" />
<add key="Password" value="%PASSWORD_VARIABLE%" />
或使用cleartextpassword
:
<add key="Username" value="user" />
<add key="ClearTextPassword" value="xxxxxx" />
查看文档nuget.config reference,了解更多详细信息。
希望这会有所帮助。