根据Artifactory官方提供的文档,在Artifactory管理界面中添加NuGet远程存储库并进行配置,然后配置NuGet客户端以使用Artifactory作为NuGet远程存储库。代码示例:
打开NuGet客户端。
运行以下命令,添加Artifactory NuGet存储库:
nuget sources add -name "Artifactory" -source "http://
运行以下命令,禁用NuGet官方存储库:
nuget sources remove -name "NuGet.org"
运行以下命令,验证是否已将Artifactory设置为NuGet远程存储库:
nuget sources list
将看到类似以下的输出:
Artifactory [http://
此时,NuGet客户端现在将使用Artifactory作为NuGet远程存储库,以解决Artifactory远程仓库与NuGet gallery之间的连接错误。