且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如果存在,Nuget创建包覆盖

更新时间:2023-12-02 18:25:04

将特定版本的软件包发布到订阅源后,将永久保留该版本号。您无法上传具有相同版本号的较新版本包,或删除它并在同一版本上传新包。

因为许多包客户端(包括NuGet)保留了本地的包缓存你的机器。一旦客户端缓存了特定的包@版本,它将在未来的安装/恢复请求中返回该副本。如果在服务器上将package @ version(rev 1)替换为新的软件包@版本(rev 2),则客户端无法区分。这可能导致来自不同机器的不确定构建结果。



因此我们无法覆盖已经上传的所有软件包,即使我们无法删除它们并重新上传。要解决此问题,唯一的方法是使用新版本上传软件包。
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.