0

Successfully building and publishing my own NuGet packages via a batch script, I would love to automatically unlist all previous versions when uploading a new version of my package.

What I'm currently doing is to manually use the web browser and unlist the previous versions.

So my question:

Is it possible to automatically unlist all previous versions when publishing a new NuGet package version?

Uwe Keim
  • 39,551
  • 56
  • 175
  • 291

1 Answers1

1

If you know the version numbers of the old versions you want to delete/unlist you should be able to script calls to NuGet delete.

NuGet.exe delete <package Id> <package version> [API Key]
Matt Ward
  • 47,057
  • 5
  • 93
  • 94
  • Thanks, Matt, that's what I thought, too. I just wanted to avoid the bookkeeping of remembering the previous version numbers. – Uwe Keim Aug 16 '14 at 15:01
  • Above example will not unlist the former package version. The package version will still be visible when going to the page of the package at nuget.org – Mohammad Mar 10 '20 at 10:04
  • Mmm, the documentation says it will unlist the package on nuget.org - https://learn.microsoft.com/en-gb/nuget/reference/cli-reference/cli-ref-delete – Matt Ward Mar 11 '20 at 11:53