nuget - 迁移到 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()
- 这不是 URL 的问题。当您尝试修改 URL 时,您将收到不同的错误
- 对服务器上的 D:\MyServer\NugetPackages 的权限不是问题,因为我已经为该文件夹设置了完全权限。我也将包文件夹移动到不同的位置(即其他一些外部网络驱动器),但我遇到了同样的问题。
我尝试编译 2 个不同的 Nuget.Server 版本:2.14.0 和 3.1.2 ...相同的异常。
在 IIS 内部,我很确定我设置了与旧服务器上相同的设置。我也有集成管道模式,所以一切都很好。我还尝试通过技术用户等设置身份验证。
不知道问题出在哪里,我想我检查了每一个设置。我尝试使用 APIKEY,但没有使用 APIKEY。我修改了 Web.config 中的每一个设置,没有运气......
解决方案
推送 nuget 数据包的 url 类似于
http://{server}/{feed}/api/v2/package
所以在你的命令中使用:
nuget push FEDivaNET.dll*.nupkg -Source http://xyz.mycompany.com/NugetFeed/api/v2/package
文档:发布包
推荐阅读
- c# - SignalR Core 和接收消息
- storyboard - 在swift5中按下特定按钮时如何使用代码呈现tabBarViewController(在情节提要中创建)?
- markdown - Markdown/Hugo 帮助:如何定义一个包含项目符号的字符串?
- linux - 如何在 Linux shell 脚本的变量中存储 echo 及其信息,而不会丢失 echo 关键字
- javascript - 将复选框输出存储到全局状态
- javascript - 如何在 Cypress 中创建 isProduction() 函数
- flutter - ImagePicker 崩溃颤振 1.22.1
- c++ - 如何在十六进制编辑器中查找变量
- django - Django不显示图像字段
- random - random_number 跨平台的行为