Tim

Footprints in the snow of a warped mind

Nuget server on IIS6 returns 404 when downloading package after upgrade

Where to find me

Flickr Icon  Twitter Icon  Linked In Icon  FaceBook Icon  Windows Live Alerts Butterfly  RSS 2.0 

Business Protection by Crisis Cover
DDD South West

Tag Cloud

AJAX (4) Analysis (3) ASP (6) ASP.Net (59) Error Reporting (4) Web Service (2) WSDL (1) Atlas (2) Born In The Barn (1) Business (87) Business Start-up Advice (30) Client (17) Expanding Your Business (21) Recruitment (1) C# (21) Canoeing (4) Canoe Racing (5) Cheshire Ring Race (5) Racing (2) Training (4) CIMA (1) Cisco (1) 7970G (1) CMS (1) Code Management (1) Cohorts (4) Commerce4Umbraco (1) Content (1) Content Management (1) Content Management System (1) CSS (3) dasBlog (5) DDD (1) Design (10) Icons (1) Development (24) eCommerce (10) Employment (2) General (39) Christmas (6) Fun and Games (11) Internet (22) Random (46) RX-8 (8) Hacking (1) Helpful Script (3) Home Cinema (2) Hosting (2) HTML (1) IIS (11) iPhone (1) JavaScript (4) jQuery (1) Marketing (6) Email (1) Multipack (1) MVC (1) Networking (3) Nintendo (1) Nuget (1) OS Commerce (1) Payment (1) Photography (1) PHP (1) PowerShell (2) Press Release (1) Productivity (3) Random Thought (1) Security (2) SEO (5) Server Maintenance (6) Server Management (11) Social Media (2) Social Networking (3) Experiment (1) Software (10) Office (5) Visual Studio (14) Windows (4) Vista (1) SQL (8) SQL Server (19) Statistics (2) Stored Procedure (1) Sublime Text 2 (1) TeaCommerce (1) Testing (2) The Site Doctor (127) Turnover Challenge (1) Twitter (3) uCommerce (11) Umbraco (30) 2009 (1) 2011 (1) Web Development (66) WebDD (33) Wii (1) XSLT (1)

Blog Archive

Search

<May 2012>
SunMonTueWedThuFriSat
293012345
6789101112
13141516171819
20212223242526
272829303112
3456789

Recent Comments

Blog Archive

Various Links

Blogs I Read

[Feed] Google Blog
Official Google Webmaster Central Blog
[Feed] Matt Cutts
Gadgets, Google, and SEO
[Feed] Ol' Deano's Blog
My mate Dean's blog on my space, equally as random as mine but not off on as much of a tangent!
[Feed] Sam's Blog
Sam is one of my younger brothers studying Product Design and Manufacture at Loughborough, this is his blog :) Enjoy!

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

newtelligence dasBlog 2.2.8279.16125

Send mail to the author(s) Email Me (Tim Gaunt)

© 2012 Tim Gaunt.

Sign In

# Friday, September 02, 2011

Nuget server on IIS6 returns 404 when downloading package after upgrade

Friday, September 02, 2011 8:03:30 AM (GMT Daylight Time, UTC+01:00)

Nuget-Returns-404-Manager-ErrorWe updated our nuget server today and ran into a problem where regardless of package selected or whether it's through the nuget package manager or the nuget package explorer, the server returns 404 (File Not Found).

Nuget-Returns-404-Explorer-Error

What was odd about this was that the packages exist and the feed was valid:

Nuget-Returns-404-Manager

There are a couple of comments about this online e.g.: Codeplex Discussion 246387 but nothing helped.  It took a while to work out that it was caused by a slight change to the way the nuget server makes it's calls. Comparing the IIS logs between the old and new version of nuget server, the previous version of nuget server would redirect the user directly to the nupkg file:

2011-04-21 08:47:46 W3SVC1759424837 192.168.1.1 GET /Packages/TheSiteDoctor.2.0.235.68.nupkg - 80 - 192.168.1.2 Package-Installer/1.2.20325.9034+(Microsoft+Windows+NT+6.1.7601+Service+Pack+1) 200 0 0

On the new one however, it passes the various requests through a new MVC route "download":

2011-09-01 11:31:16 W3SVC1759424837 192.168.1.1 GET /download/TheSiteDoctor/2.0.235.68 - 80 - 192.168.1.2 Package-Installer/1.2.20325.9034+(Microsoft+Windows+NT+6.1.7601+Service+Pack+1) 404 0 3

This is fine if your nuget server is running on IIS7, it will "just work". However if you're running IIS6 you'll need to make one additional change which is mapping all request through the aspnet_isapi.dll (a wildcard mapping). This is easy enough:

  1. 1. Open the site's properties in IIS6
  2. 2. Navigate to the "Home Directory" tab
  3. 3. Click the "Configuration" button:
    Nuget-Returns-404-Explorer-IIS
  4. This will then open the "Application Configuration" window:
    Nuget-Returns-404-Explorer-IIS-Configuration
  5. Now you'll need to add the aspnet_isapi.dll mapping, the path of this will depend on the whether you're running Windox 64bit or not:
    32bit Framework: c:\windows\microsoft.net\framework\v4.0.30319\aspnet_isapi.dll
    64bit Framework: c:\windows\microsoft.net\framework64\v4.0.30319\aspnet_isapi.dll
    Make sure you uncheck the "Verify that file exists" checkbox
    Nuget-Returns-404-Explorer-IIS-Wildcard

Et voila your packages should all be working again.

Leave a comment if you need any additional help or it helped you.

 

Don't forget to follow me on Twitter.

Tuesday, September 13, 2011 9:22:28 PM (GMT Daylight Time, UTC+01:00)
Amazingly helpful...I only wish I had checked the IIS logs sooner. Thanks for the great post!
Wednesday, December 21, 2011 6:38:26 PM (GMT Standard Time, UTC+00:00)
Yes, there should be a note in the installation docs or readme.txt about IIS6. Thank you!
Ron
Thursday, April 19, 2012 1:31:28 PM (GMT Daylight Time, UTC+01:00)
Thanks, really helpful. I was scratching my head for the last couple of hours because of this problem
Name
E-mail
(will show your gravatar icon)
Home page

Comment (HTML not allowed)  

Live Comment Preview