我正在托管一个使用 Nuget.Server 包构建的私有 Nuget 服务器。
这台机器暴露了 8082 端口。 nuget 服务器可通过 web 浏览器访问http://domain:8082/nuget,发布工作正常。
现在我正在尝试启用 VS2017 来使用来自这个 nuget 服务器的包。添加新包源“ http://mydomain:8082/nuget ”后,我可以浏览我的包,但 Install-Package 失败。显然它在构建下载链接时忽略了端口号。
这是输出:
PM> Install-Package MyPackage
Restoring packages for D:\someproject.csproj...
GET https://www.nuget.org/api/v2/FindPackagesById()?id='Newtonsoft.Json'&semVerLevel=2.0.0
GET https://www.myget.org/F/aspnetvnext/api/v2/FindPackagesById()?id='Newtonsoft.Json'&semVerLevel=2.0.0
GET http://mydomain:8082/nuget/FindPackagesById()?id='Newtonsoft.Json'&semVerLevel=2.0.0
GET https://www.nuget.org/api/v2/FindPackagesById()?id='MyPackage'&semVerLevel=2.0.0
GET https://www.myget.org/F/aspnetvnext/api/v2/FindPackagesById()?id='MyPackage'&semVerLevel=2.0.0
GET http://mydomain:8082/nuget/FindPackagesById()?id='MyPackage'&semVerLevel=2.0.0
OK http://mydomain:8082/nuget/FindPackagesById()?id='Newtonsoft.Json'&semVerLevel=2.0.0 44 мс
OK http://mydomain:8082/nuget/FindPackagesById()?id='MyPackage'&semVerLevel=2.0.0 62 мс
GET http://mydomain/nuget/Packages(Id='MyPackage',Version='1.0.1')/Download
OK https://www.nuget.org/api/v2/FindPackagesById()?id='Newtonsoft.Json'&semVerLevel=2.0.0 431 мс
OK https://www.nuget.org/api/v2/FindPackagesById()?id='MyPackage'&semVerLevel=2.0.0 441 мс
OK https://www.myget.org/F/aspnetvnext/api/v2/FindPackagesById()?id='MyPackage'&semVerLevel=2.0.0 1436 мс
OK https://www.myget.org/F/aspnetvnext/api/v2/FindPackagesById()?id='Newtonsoft.Json'&semVerLevel=2.0.0 1471 мс
Unable to download package "MyPackage.1.0.1" из "http://mydomain/nuget/Packages(Id='MyPackage',Version='1.0.1')/Download".
Error while sending request.
Unable to connect to remote server
A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond <mydomain's IP here>:80
有没有办法解决这种行为?