gpt4 book ai didi

Azure DevOps 设置多个源以恢复包

转载 作者:行者123 更新时间:2023-12-02 07:47:04 24 4
gpt4 key购买 nike

尝试设置 Azure DevOps 管道并且当前还原包对于我的 ServiceStack 包失败,因为我需要的版本不在默认 nuget.org 源中。我想要的版本位于 MyGet.org 提要中。

如何以及在哪里为这个附加包在 dev.azure.com 门户中设置附加 MyGet 源,以便 Azure DevOps 可以恢复它?

https://www.myget.org/F/servicestack

     NuGet Config files used:
D:\a\1\Nuget\tempNuGet_1.config

Feeds used:
https://api.nuget.org/v3/index.json

Installed:
78 package(s) to D:\a\1\s\SomeApi\SomeApi.csproj
Done executing task "RestoreTask" -- FAILED.
1>Done building target "Restore" in project "SomeApi.csproj" -- FAILED.
1>Done Building Project "D:\a\1\s\SomeApi\SomeApi.csproj" (Restore target(s)) -- FAILED.

构建失败。

   "D:\a\1\s\SomeApi\SomeApi.csproj" (Restore target) (1) ->
(Restore target) ->
D:\a\1\s\SomeApi\SomeApi.csproj : error NU1102: Unable to find package ServiceStack with version (>= 5.4.1)## Heading ##
D:\a\1\s\SomeApi\SomeApi.csproj : error NU1102: - Found 181 version(s) in nuget.org [ Nearest version: 5.4.0 ]

0 Warning(s)
1 Error(s)

最佳答案

Azure DevOps setting up multiple feeds for restoring packages

您可以在解决方案资源管理器上右键单击您的解决方案,然后添加包含以下内容的 nuget.config 文件:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="MyGetCustomFeed" value="https://dotnet.myget.org/xxx/v3/index.json" />
</packageSources>

<packageSourceCredentials>
<MyGetCustomFeed>
<add key="Username" value="xxx" />
<add key="ClearTextPassword" value="xxxx" />
</MyGetCustomFeed>
</packageSourceCredentials>
</configuration>

然后将此文件提交到您的存储库,并在 nuget 恢复任务中选择此文件:

enter image description here

希望这有帮助。

关于Azure DevOps 设置多个源以恢复包,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55167395/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com