【问题标题】:NuGet packages do not show after pushing to private NuGet Feed (NuGet.Server, IIS)推送到私有 NuGet 源(NuGet.Server、IIS)后,NuGet 包不显示
【发布时间】:2015-11-16 20:00:35
【问题描述】:

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

  1. 创建一个空的 Web 应用程序
  2. 安装了NuGet.Server
  3. 在 Web.config 中将 ~/Packages 设置为 packagesPath
  4. 在 Web.config 中设置我的 API 密钥
  5. 使用 NuGet.exe 从类库创建 .nupkg 文件
  6. 在 IIS 中创建了一个名为“NuGet”的新应用程序
  7. 授予IUSRIIS_IUSRS 用户和组的读/写访问权限
  8. 从命令行运行nuget setApiKey ABC123 -Source http://localhost/NuGet
  9. 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 作为包源之一后,我也无法安装我刚刚推送的包。

这一切都在运行:

  • Windows 7
  • IIS 7.5

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

【问题讨论】:

    标签: visual-studio iis nuget nuget-server


    【解决方案1】:

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

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2013-12-12
      • 1970-01-01
      • 2022-11-24
      • 1970-01-01
      • 1970-01-01
      • 2019-07-04
      • 2015-09-13
      相关资源
      最近更新 更多