问题描述
在使用时
nuget.exe push \\share\Packages\*.nupkg -Source "https://myvsts.pkgs.visualstudio.com/_packaging/tcpcm/nuget/v3/index.json" -ApiKey VSTS
我得到了
错误
是否可以覆盖所有已上传的软件包?
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.
因为许多软件包客户端(包括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.
这篇关于覆盖Visual Studio Team Services Feed中的nuget包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!