overwrite nuget packages in feed on visual studio team services

孤人 提交于 2019-12-19 16:35:52

问题


while using

nuget.exe push \\share\Packages\*.nupkg -Source "https://myvsts.pkgs.visualstudio.com/_packaging/tcpcm/nuget/v3/index.json" -ApiKey VSTS

i got an

Response status code does not indicate success: 409 (Conflict).

error

is there a way to overwrite all packages that have already been uploaded?


回答1:


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.

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.




回答2:


This is intentionally prohibited in VSTS.




回答3:


Try adding ?replace=true at the end of the URL. Alternatively you could try AllowOverwriteExistingPackages=true.

I'm not sure if visualstudio.com already supports this, but this is how it's working in case of Octopus Deploy's NuGet server.



来源:https://stackoverflow.com/questions/44844661/overwrite-nuget-packages-in-feed-on-visual-studio-team-services

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!