Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NuGet - Installing Individual Packages reporting "The remote server returned an error: (404) Not Found."

When using a local NuGet server, whenever I try to install an individual package from that server, all I get is this error: "The remote server returned an error: (404) Not Found."

enter image description here

The packages are all there in the filesystem and the feed itself sees all the packages appropriately. I can even browse the package directly!

What am I missing?

I did just upgrade from NuGet server 1.4 to 1.5, but I've seen this happen before. Touching the package files used to help, but that does not appear to be the case now.

EDIT: Actually, I hadn't seen that exact error before...I've seen this one, intermittently, that touching the package tended to fix.

like image 210
Brandon Linton Avatar asked Sep 13 '11 20:09

Brandon Linton


3 Answers

On Windows Server 2008, I was having the same issue. I switched the Application Pool from "ASP.NET v4.0 Classic" to "ASP.NET v4.0". The install-package command worked fine after the change.

like image 191
jhamm Avatar answered Nov 18 '22 05:11

jhamm


sigh...

http://blogs.thesitedoctor.co.uk/tim/2011/09/02/Nuget+Server+On+IIS6+Returns+404+When+Downloading+Package+After+Upgrade.aspx

EDIT: In case the link ever dies...I am hosting my NuGet server in IIS6, which wasn't set up to properly handle extensionless URLs. And since the semantics of downloading individual packages changed from a direct file link to an extensionless route, I started getting 404s. Adding the wildcard mapping described in the article fixed it instantly.

like image 24
Brandon Linton Avatar answered Nov 18 '22 05:11

Brandon Linton


I've been trying to figure this for a couple of hours...

Checked the IIS logs and discovered that URLScan was blocking the route:

GET /Rejected-By-UrlScan ~/api/v2/package/

URLScan doesn't accept any route not starting with '/'. The best I could do was to remove the URLScan from the list of ISAPI filters for the website in the IIS Manager.

like image 3
nicodemus13 Avatar answered Nov 18 '22 05:11

nicodemus13