gpt4 book ai didi

nuget - 您可以恢复属于另一个 VSTS 帐户的 VSTS 源中的包吗?

转载 作者:行者123 更新时间:2023-12-04 21:10:21 26 4
gpt4 key购买 nike

我的公司有许多 Visual Studio Team Services 帐户。我们有一个用于内部开发,一个用于我们的每个客户。我们在内部开发帐户 (https://{dev-account}.visualstudio.com/DefaultCollection) 中托管我们的内部 nuget 库,我想在客户帐户 (https://{client-account}.visualstudio.com/DefaultCollection) 中运行构建时恢复包。
我使用 bootstrap tools 设置存储库,在我的 VSTS 构建中,我添加了一个批处理脚本构建步骤来执行 init.cmd .这很好,但是,下一步是 NuGet 包还原,它无法在开发帐户的 NuGet 源中找到包:

2016-03-22T23:34:37.5398840Z Please provide credentials for:https://{dev-account}.pkgs.visualstudio.com/DefaultCollection/_packaging/{my-feed}/nuget/v3/index.json

2016-03-22T23:34:37.5408842Z UserName: Password: WARNING: Unable tofind version '1.9.0.10' of package '{my-package}'.


这是有道理的,因为提要位于单独的 VSTS 帐户中,并且构建代理没有访问提要的权限。
有没有办法解决?我知道 MyGet,它提供免费的公共(public)提要,但如果可能的话,我想使用 VSTS。

最佳答案

我对这个解决方案并不感到兴奋,但它确实有效。您可以在 nuget.config 中存储包源的凭据:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
<config>
<clear />
<add key="repositoryPath" value="packages" />
</config>
<packageSources>
<!-- When <clear /> is present, previously defined sources are ignored -->
<!-- Remove this tag or un-comment the nuget.org source below to restore packages from nuget.org -->
<!-- For more info, see https://docs.nuget.org/consume/nuget-config-file -->
<clear />
<add key="vss-package-management" value="https://www.myget.org/F/vss-package-management/api/v2" />
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
<add key="{dev-account}" value="https://{dev-account}.pkgs.visualstudio.com/DefaultCollection/_packaging/{feed}/nuget/v3/index.json" />
</packageSources>
<activePackageSource>
<add key="All" value="(Aggregate source)" />
</activePackageSource>
<packageSourceCredentials>
<{dev-account}>
<add key="Username" value="username" />
<add key="ClearTextPassword" value="password" />
</{dev-account}>
</packageSourceCredentials>
</configuration>

关于nuget - 您可以恢复属于另一个 VSTS 帐户的 VSTS 源中的包吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36167340/

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