首页 > 解决方案 > 迁移到 Win 2016 后的 Nuget 服务器问题

问题描述

我已将 nuget 存储库从 Win 2008 迁移到 Win 2016。该服务器的别名:http: //xyz.mycompany.com/NugetFeed

除了 windows,IIS 也不同,在新服务器上是 IIS 10。

迁移后,nuget 运行良好,除了一个功能。我可以通过网络(http://xyz.mycompany.com/NugetFeed)或通过 Visual Studio 等浏览包。Visual Studio 可以看到手动创建的包。

唯一的问题是nuget push。

>nuget push FEDivaNET.dll*.nupkg -Source http://xyz.mycompany.com/NugetFeed/ D568CD48-1609-40C9-9A5D-7ADC808129E5 Pushing FEDivaNET.dll.3.41.73.nupkg to 'http://xyz.mycompany.com/NugetFeed/'... PUT http://xyz.mycompany.com/NugetFeed/ NotFound http://xyz.mycompany.com/NugetFeed/ 128ms Response status code does not indicate success: 404 (Not Found). System.Net.Http.HttpRequestException: Response status code does not indicate success: 404 (Not Found). at System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode() at NuGet.Protocol.Core.Types.PackageUpdateResource.<>c.<PushPackageToServer>b__23_0(HttpResponseMessage response) at NuGet.Protocol.HttpSource.<ProcessResponseAsync>d__181.MoveNext()

我尝试编译 2 个不同的 Nuget.Server 版本:2.14.0 和 3.1.2 ...相同的异常。

在 IIS 内部,我很确定我设置了与旧服务器上相同的设置。我也有集成管道模式,所以一切都很好。我还尝试通过技术用户等设置身份验证。

不知道问题出在哪里,我想我检查了每一个设置。我尝试使用 APIKEY,但没有使用 APIKEY。我修改了 Web.config 中的每一个设置,没有运气......

标签: nugetnuget-server

解决方案


推送 nuget 数据包的 url 类似于

http://{server}/{feed}/api/v2/package

所以在你的命令中使用:

nuget push FEDivaNET.dll*.nupkg -Source http://xyz.mycompany.com/NugetFeed/api/v2/package

文档:发布包


推荐阅读