zoukankan      html  css  js  c++  java
  • Nuget server on IIS6 returns 404

    Nuget server on IIS6 returns 404 when downloading package after upgrade

    2011年9月2日 8:03:30 (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:windowsmicrosoft.netframeworkv4.0.30319aspnet_isapi.dll 
      64bit Framework: c:windowsmicrosoft.netframework64v4.0.30319aspnet_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.

  • 相关阅读:
    【翻译】ASP.NET MVC深度接触:ASP.NET MVC请求生命周期
    水木年华亲笔签名《ASP.NET第一步》等你来拿!!
    《C#与.NET 3.0高级程序设计(特别版)》横空出世
    是什么让你萌发了跳槽的念头?
    (原创)无废话C#设计模式之十八:Command
    (原创)无废话C#设计模式之十六:State
    (原创)无废话C#设计模式之二十:Mediator
    推荐文章索引
    技术图书非常难写
    【翻译】创建IQUERYABLE提供器系列文章
  • 原文地址:https://www.cnblogs.com/zqmingok/p/3531849.html
Copyright © 2011-2022 走看看