Command line Push to Private NuGet Gallery fails with Failed to process request. 'OK'

StackOverflow https://stackoverflow.com/questions/11076709

  •  15-06-2021
  •  | 
  •  

Pregunta

I’ve set up a private NuGet Gallery from github.com/NuGet/NuGetGallery using instructions from here: http://dotnet.dzone.com/news/how-set-local-nuget-gallery
The Gallery works ok, it allows users to log in and upload packages using the Web UI as well as retrieve package updates using nuget.exe and the Visual Studio add in. However, when I try use nuget.exe (version 1.8) to push to the Gallery like this:

nuget.exe push myPackage.4.0.0.12.nupkg -Source "http://myServer/NuGetGallery/"

I get:

Failed to process request. 'OK'.
.

With upload working ok through the Web UI I'm pretty sure that file/directory permissions must be set correctly.
Unfortunately Failed to process request isn't as useful an error message as it could be.
So I'm not sure what else could be wrong?

¿Fue útil?

Solución

When using the Push command from NuGet.exe (1.8) to a Privately setup NuGet Gallery the -Source option needs to include the full path to api/v2/package, so in my case it’s: nuget.exe

push myPackage.4.0.0.12.nupkg -Source "http://myserver/NuGetGallery/api/v2/package"

I get the feeling that this could also be fixed with a rewrite rule in the web.config or perhaps a Route somewhere isn’t working, so if someone has a better solution then I’d be keen to hear it.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top