使用时
nuget.exe push \\share\Packages\*.nupkg -Source "https://myvsts.pkgs.visualstudio.com/_packaging/tcpcm/nuget/v3/index.json" -ApiKey VSTS
我有一个
Response status code does not indicate success: 409 (Conflict).
错误
有没有办法覆盖所有已经上传的包?
最佳答案
is there a way to overwrite all packages that have already been uploaded?
简单的答案是否定的。Jonathan Myers 的回答指出了正确的文档:Understand immutability of packages .
Once you publish a particular version of a package to a feed, that version number is permanently reserved. You cannot upload a newer revision package with that same version number, or delete it and upload a new package at the same version.
这是因为许多包客户端(包括 NuGet)在您的计算机上保留了包的本地缓存。一旦客户端缓存了特定的
package@version
,它将在将来的安装/恢复请求中返回该副本。如果在服务器上替换 package@version
(修订版 1)带有新的 package@version
(修订版 2),客户端无法区分。这可能导致来自不同机器的不确定构建结果。所以我们不能覆盖所有已经上传的包,即使我们不能删除它们并重新上传。要解决这个问题,唯一的办法就是上传新版本的包 .
关于visual-studio - 在 Visual Studio 团队服务的提要中覆盖 nuget 包,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44844661/