Search code examples
nugetnuget-packagenuget-server

Unable to delete NuGet package on server


I am unable to delete a NuGet package that I have uploaded onto our local NuGet server, the NuGet server is v2.8.50320.36 and the command line NuGet.exe is 2.0.6.

When I use the following command:

nuget delete Newtonsoft.Json 6.0.3 myapikey -source http://nuget.mycompany.com/ -NonInteractive -verbosity detailed

I get the following output

Deleting Newtonsoft.Json 6.0.3 from the 'http://nuget.mycompany.com/'.
Failed to process request. 'Internal Server Error'. 
The remote server returned an error: (500) Internal Server Error..

However I had no problem pushing the package on to the server (I've checked it's definitely there), this was the command I used to push it.

nuget push "C:\Temp\Newtonsoft.Json.6.0.3.nupkg" myapikey -source http://nuget.mycompany.com/ -verbosity detailed

Are there any settings I need to make on the NuGet server to allow package deletion or is my command syntax incorrect?


Solution

  • It is strongly discouraged to delete a package from a feed, because that will break builds that have a dependency on that package. See:

    http://nuget.codeplex.com/discussions/284211

    In the rare occasion that I really have to delete a package, I delete it in the Packages folder of the file system on the server.

    But if you insist on doing it via nuget.exe, maybe the following link will help you.

    https://github.com/NuGet/NuGetGallery/issues/1229

    Update

    Solution in the comments below: "set enableDelisting to true in the web.config file."