将NuGet包推送到私有NuGet Feed(NuGet.Server,IIS)后无法显示

4

我按照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 显示?
1个回答

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

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


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接