Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

overwrite nuget packages in feed on visual studio team services

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?

like image 465
Ingo B Avatar asked Jun 30 '17 10:06

Ingo B


People also ask

How do I overwrite a NuGet package?

To resolve this issue, the only way is that upload the packages with a new version. ok thanks for the info, what i now did was to upload all packages to source code and then create a build definition for nuget push.

How do I update NuGet package references?

Update a package. In Solution Explorer, right-click either References or the desired project, and select Manage NuGet Packages.... (In web site projects, right-click the Bin folder.) Select the Updates tab to see packages that have available updates from the selected package sources.

How do I add a NuGet package to a feed?

Set up Visual Studio Select NuGet Package Manager, and then select Package Sources. Enter the feed's Name and Source URL, and then select the green (+) sign to add a new package source. If you enabled upstream sources in your feed, clear the nuget.org checkbox. Select OK when you are done.

How do I clean up NuGet packages?

Open Visual Studio, go to Tools -> NuGet Package Manager -> Package Manager Settings menu. Click Clear All NuGet Cache(s) button in options dialog then clearing process is started. Once NuGet cache location is cleared, click ok button.


1 Answers

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.

like image 82
Leo Liu-MSFT Avatar answered Sep 18 '22 20:09

Leo Liu-MSFT