覆盖Visual Studio Team Services Feed中的nuget包
在使用时
nuget.exe push \\share\Packages\*.nupkg -Source "https://myvsts.pkgs.visualstudio.com/_packaging/tcpcm/nuget/v3/index.json" -ApiKey VSTS
我得到了
响应状态代码未指示成功:409(冲突)。
Response status code does not indicate success: 409 (Conflict).
错误
是否可以覆盖所有已上传的软件包?
is there a way to overwrite all packages that have already been uploaded?
有没有办法覆盖所有已上传的软件包?
is there a way to overwrite all packages that have already been uploaded?
简单的答案是不会。乔纳森·迈尔斯的答案指出了正确的文档:了解软件包的不可变性。
The simple answer is No. Jonathan Myers`s answer pointed out the correct document: 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) ),客户无法分辨出差异。这可能导致来自不同机器的不确定的构建结果。
That because many package clients, including NuGet, keep a local cache of packages on your machine. Once a client has cached a particular package@version
, it will return that copy on future install/restore requests. If, on the server, you replace package@version
(rev 1) with a new package@version
(rev 2), the client is unable to tell the difference. This can lead to indeterminate build results from different machines.
所以我们无法覆盖所有已经上传的软件包,即使我们不能删除它们并重新上传。要解决此问题,唯一的方法是用新版本上传软件包。
So we could not overwrite all packages that have already been uploaded, even we could not delete them and re-uploaded. To resolve this issue, the only way is that upload the packages with a new version.