推送到私有 NuGet 源后不显示 NuGet 包(NuGet.Server,IIS)

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

我按照 Hosting Your Own NuGet Feeds 上的说明操作:

  1. 创建一个空的网络应用程序
  2. 安装了 NuGet.Server
  3. ~/Packages设置为Web.config
  4. 中的packagesPath
  5. 将我的 API 键设置为 Web.config
  6. 使用 NuGet.exe
  7. 从 class 库创建了 .nupkg 文件
  8. 在 IIS 中创建了一个名为 "NuGet"
  9. 的新应用程序
  10. 授予 Read/Write 对 IUSRIIS_IUSRS 用户和组的访问权限
  11. 运行 nuget setApiKey ABC123 -Source http://localhost/NuGet 来自命令行
  12. 运行 nuget push Foo.Bar.dll.nupkg -Source http://localhost/NuGet

推送到NuGet服务器成功。我可以在 Windows 资源管理器中查看文件夹并查看 .nupkg 文件。

当我转到 http://localhost/NuGet/nuget/Packages 时,我得到一个 RSS 提要,其中显示了我刚刚推送的包。

当我转到 http://localhost/NuGet/nuget/ 时,我得到一个空的包列表:

<?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>

在 Visual Studio 中配置 NuGet 以将 http://localhost/NuGet 作为包源之一包含后,我也无法安装刚刚推送的包。

这是 运行 上的所有内容:

为什么 NuGet 包显示在 RSS 提要 (/NuGet/nuget/Packages) 中,而不是通过 /NuGet/nuget

因为 /NuGet/nuget/Packages 是列出包的 URL(它恰好是 RSS 格式,因为这是最初的实施决定),而 /NuGet/nuget 是 API 用于推送、删除等包操作的端点

您发布的 XML 不是一个空的包列表,它更像是一个服务描述符。一个空的包列表将是在以下位置找到的结果:/NuGet/nuget/Packages()?$filter=1 eq 2