title | description | ms.assetid | ms.prod | ms.technology | ms.manager | ms.author | author | ms.topic | ms.date | monikerRange |
---|---|---|---|---|---|---|---|---|---|---|
Unlist, delete, or recover a NuGet package |
Unlist, delete, or recover a deleted NuGet package from Visual Studio Team Services (VSTS) or Team Foundation Server (TFS) |
173070F7-CF0B-41DE-AD8B-1881E04E1457 |
devops |
devops-artifacts |
douge |
elbatk |
elbatk |
conceptual |
09/01/2017 |
>= tfs-2017 |
VSTS | TFS 2018 | TFS 2017
There are two options available to remove a version of a NuGet package from a feed.
- Unlist: Unlisting a version of a package modifies how the package appears in NuGet clients (see the NuGet docs for a full description of how unlist works). Unlisting a version can help you prevent new usage of it without breaking dependent projects and builds.
- Delete: Deleting a version of a package makes it unavailable for install. After deleting, a package can be restored from the Recycle Bin within 30 days of deletion. After 30 days, it is permanently unavailable to restore. Deleting a package will cause others that depend on it to break.
Unlist and delete both respect feed immutability. 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.
You must be a contributor to unlist and an owner to delete.
Choose the package from the Packages hub in the Build and Release hub group and select the appropriate option from the menu:
First, get the tools (make sure you're using NuGet 3.5 or later) and your feed URL:
Then, run
nuget.exe delete {your_package_id} {version} -Source {feed URL} -ApiKey key
Currently, NuGet.exe can only unlist packages; VSTS and TFS interpret nuget.exe delete
as an unlist operation to be consistent with NuGet.org. To delete a package, you must use either the REST APIs or the web interface.