Search code examples
visual-studioiisnugetnuget-server

NuGet packages do not show after pushing to private NuGet Feed (NuGet.Server, IIS)


I followed the instructions on Hosting Your Own NuGet Feeds:

  1. Create an empty web application
  2. Installed the NuGet.Server package
  3. Set ~/Packages as the packagesPath in Web.config
  4. Set my API key in Web.config
  5. Created the .nupkg file from a class library using NuGet.exe
  6. Created a new Application in IIS called "NuGet"
  7. Granted Read/Write access to the IUSR and IIS_IUSRS users and groups
  8. Ran nuget setApiKey ABC123 -Source http://localhost/NuGet from the command line
  9. Ran nuget push Foo.Bar.dll.nupkg -Source http://localhost/NuGet

The push to the NuGet server succeeded. I can view the folder in Windows Explorer and see the .nupkg file.

When I go to http://localhost/NuGet/nuget/Packages I get an RSS feed showing the package I just pushed.

When I go to http://localhost/NuGet/nuget/ I get an empty list of packages:

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<service xml:base="http://localhost/NuGet/nuget/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:app="http://www.w3.org/2007/app" xmlns="http://www.w3.org/2007/app">
  <workspace>
    <atom:title>Default</atom:title>
    <collection href="Packages">
      <atom:title>Packages</atom:title>
    </collection>
  </workspace>
</service>

After configuring NuGet in Visual Studio to include http://localhost/NuGet as one of the package sources, I can't install the package I just pushed either.

This is all running on:

  • Windows 7
  • IIS 7.5

Why does the NuGet package show up in the RSS feed (/NuGet/nuget/Packages), but not through /NuGet/nuget?


Solution

  • Because /NuGet/nuget/Packagesis the URL where packages are listed (it just happens to be in RSS format because that was the original implementation decision), and /NuGet/nuget is the API endpoint used for package operations such as pushing, deleting, etc.

    The XML you've posted isn't an empty list of packages, it's more of a service descriptor. An empty list of packages would be the result found at: /NuGet/nuget/Packages()?$filter=1 eq 2