在视觉工作室团队服务的提要中覆盖 nuget 包 [英] overwrite nuget packages in feed on visual studio team services
问题描述
使用中
nuget.exe push \sharePackages*.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?
简单的答案是否定的.Jonathan Myers 的回答指出了正确的文档:了解包的不变性.
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
(rev 1) 替换为新的 package@version
(rev 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.
这篇关于在视觉工作室团队服务的提要中覆盖 nuget 包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!