4

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?

openshac
  • 4,966
  • 5
  • 46
  • 77

1 Answers1

2

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."

openshac
  • 4,966
  • 5
  • 46
  • 77
frank koch
  • 1,138
  • 2
  • 14
  • 27
  • We are using v2.8.5 so I think that issue you reference is already fixed. In our case we need to delete packages from our internal feed/server when breaking changes are made in dependent systems. – openshac Jul 01 '14 at 10:00
  • I am curious: is the Nuget.Server that You are using from here http://www.nuget.org/packages/NuGet.Server ? The most recent package version is 2.8.2! And why are you using a new Server and a rather dated nuget.exe-client? Have you tried this with a more up-to-date nuget.exe? – frank koch Jul 01 '14 at 15:12
  • When I browse to nuget.mycompany.com is says "You are running NuGet.Server v2.8.50320.36", I think this might be the file version as opposed to the product version which is displayed on the nuget site you refer to. As you mention I was using an out of date client, I have updated that to be 2.8.2 (file version 2.8.5056.491) but I still get an identical error. – openshac Jul 01 '14 at 15:43
  • I would suggest to gather additional diagnostic information about the 500 error. E.g. read the IIS-Server logs, have Fiddler running when the error occurs, enable the detailed error pages. The steps are outlined in the question of this stackoverflow item: http://stackoverflow.com/questions/8895804/why-does-my-nuget-gallery-return-500-from-nuget-push – frank koch Jul 01 '14 at 16:45
  • I tried your command-line on our old v2.2.31210.9045 nuget-server (we have moved to NuPeek and then to ProGet) and it worked. There are no special settings in the web.config of this version, but I saw that newer versions have a setting "enableDelisting". And as final tip: maybe you should post your question at http://nuget.codeplex.com/ – frank koch Jul 02 '14 at 05:56