F:\test>NuGet.exe push MyPackage.188.8.131.52.nupkg -Source http://nugetrepo/ -ApiKey myApiKey
Pushing MyPackage 184.108.40.206 to 'http://nugetrepo:81/'...
Failed to process request. 'Not Found'.
The remote server returned an error: (404) Not Found..
Short versionThe cause in my case was that the package was too big. If your package is moderately large you need to set the maxAllowedContentLength setting to a larger number:
<requestLimits maxAllowedContentLength="32212254720"> </requestLimits>
This setting controls the biggest file size accepted by IIS. Notice this setting is specified in bytes.
You also need to set ASP.NET's maxRequestLength setting to a corresponding large number (this time in Kb):
<httpRuntime maxRequestLength="31457280" targetFramework="4.5"></httpRuntime>
Full versionObvious things discarded (wrong api key, wrong URL, server not available, etc) I then turned to Fiddler. 2 requests are made by the NuGet.exe client:
- The first one a GET to the site root (http://nugetrepo). This is sucessful.
- A subsequent PUT to http://nugetrepo/api/v2/package which fails with a 404 error.
I went on and enabled IIS Failed Request Tracing (see here) which gave me the key piece of information: the error was a 404.13. For some reason I didn't see that 404.13 on Fiddler.
Once I knew the cause it was fairly straight forward to find the solution.
Hope this helps! It will certainly help myself in the future.