F:\test>NuGet.exe push MyPackage.126.96.36.199.nupkg -Source http://nugetrepo/ -ApiKey myApiKey
Pushing MyPackage 188.8.131.52 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.