Search code examples
packagenuget

How to remove NuGet Package from server?


I have added new package to Nuget (I'm not talking about adding reference of package into project). I have added new packages to server so that others can consume/use that package in their projects.

Say package name was Parser1.0.0.0.nupkg.

Problem is I forgot to add one dependency. Now I want to edit or delete and add correct one again. But I don't want to change its version number.

Anyone knows how to do it?


Solution

  • Permanently deleting packages is not supported, but you can control how they are listed. (assuming you're talking about nuget.org).

    After signing in, in there is additional information on the delete package page. e.g. https://nuget.org/packages/Parser/1.0.0.0/Delete.

    Quoting nuget's explanation from the delete package page :

    "Why can’t I delete my package? Our policy is to only permanently delete NuGet packages that really need it, such as packages that contain passwords, malicious/harmful code, etc. This policy is very similar to the policies employed by other package managers such as Ruby Gems.

    Unlisting the package will remove the package from being available in the NuGet. The package is still available for download as a dependency for three main reasons.

    Other packages may depend on that package. Those packages might not necessarily be in this gallery. Ensures that folks using NuGet without committing packages (package restore) will not be broken. Helps ensure that important community owned packages are not mass deleted."

    I would suggest unlisting the previous package and bumping the version to 1.0.0.1 after adding the dependency.