Search code examples
c#asp.netiisiis-8nuget-server

Nuget.Server can list packages but 404's on package install


So I have an ASP.Net Nuget Server running on a machine on our network. I'm using .Net 4.6 with Nuget.Server version 2.11.2.0 and IIS 8.

This is connected to our automated build system so the packages are automatically created and copied to the ~/Packages directory after a successful build, when I go to the server URL in a browser I can see the splash page and click on the packages link to see the available packages XML page. If I put the package URL into Nuget settings in Visual Studio then it will list the packages available but then 404 when I hit 'Install', see the image below.

Note that it also 404's when I try to push a package using the command on the server splash page.

I've tried using curl to see if the routes are actually available, I get a 404 from api/v2/package and also from nuget/package. The IIS logs showed a 404 on http:///api/v2/package//etc... so I figured I'd at least check that route was available, and it appears it isn't. I don't understand why this would be the case.

list but fail install

Things I have already tried;

  • nupkg Mime type is set to application/zip in IIS
  • IIS Application Pool mode is set to integrated
  • aspnet_isapi.dll exists in both Framework64/Framework folders for .NET 4.5
  • runAllManagedModulesForAllRequests is set to false in the Web.config

My question essentially revolves around a few things;

  • are there any internal ports that the server uses that I might not have opened yet? (i.e. I've opened port 51702 which is the default Nuget.Server port, but I'm assuming the http requests will run on port 80 or 443)
  • Has anyone else had a similar issue besides the things I've already tried?

Solution

  • This is now working; I'm not entirely sure what fixed it as I made a few changes at once. Most notably;

    • I upgraded from .NET 4.5 to 4.6 and updated Nuget.Server accordingly, I think this changes the routing from the server/nuget/package/{package-id}/{version} to server/api/v2/package/{package-id}/{version}
    • I changed runAllManagedModulesForAllRequests to true in the Web.config