Remove NuGet packages from Visual Studio online packages feed instead of Unlist

Can packages be removed NuGet

from the Visual Studio Online package feed?

I installed CI in Visual Studio Online using build tasks for dotnet core project.

One step consists of pack

all projects in the solution as packages NuGet

and push

as a package.

The build works fine, however in my first attempt at build steps pack

and push

I used a **/.csproj

wildcard instead src/**/.csproj

. So it packed and pushed all my test projects that were under tests/**

.

I want to remove these packages from the feed. The only option I could find in the UI is unlist

packages. But after this operation, the packages still exist.

I also tried to remove the packages through the CLI: nuget delete

. But it just does the same thing as unlist

.

Has anyone been able to remove their packages?

+3


source to share


1 answer


Yes, it's possible out of the box with VSTS package management. Please note that there is a difference between list and delete, which I will go into in detail.

TL history; The DR for removing existing packages from VSTS package management is that you must be the "owner" of the package or have the "Project Admin" role to remove it. To lock a package, you only need the "contributor" role. For both options, simply go to Batch Information in VSTS and select the appropriate option from the menu below the ellipses:

Delete screenshot

Now for some background information that might be helpful. There is official documentation at visualstudio.com :

There are two options for removing a NuGet package version from your feed.

Unlist : De-versioning a package changes the way the package is displayed in NuGet clients (see the NuGet docs for a complete description of how the user list works). Denying a version can help you prevent a version from being used without breaking dependent projects and assemblies.

Delete . Removing a version of a package makes it unavailable for installation or repair.

Undo and remove both feed immutability values . When you publish a specific version of a package to a feed, that version number is retained forever. You cannot download a new fix pack with the same version number, or uninstall it and download a new fix pack with the same version.

The important part here is "constant feed" which , according to canon , translates to:



Once you publish a specific version of a package to your feed, that version number is permanently stored. You cannot download a new fix pack with the same version number, or uninstall it and download a new fix pack with the same version.

The documentation also confirms, as a footnote at the bottom, what you've already discovered about nuget.exe:

Currently NuGet.exe can only check out packages; Team Services and TFS interpret nuget.exe as an unlist operation to match NuGet.org. To remove a package, you must use either the REST API or the web interface.

Executing it programmatically must be done either through the REST API or in the VSTS admin section as described above. NuGet.exe can only be used for exclusion, not deletion.

With all things considered with VSTS, you can remove packages, but as always, think twice before doing so. Remember the LeftPad ending?; )

+7


source







All Articles