【发布时间】:2016-01-28 16:33:30
【问题描述】:
有没有人成功地在 VSTS 中使用本地(非面向公众)Nuget 服务器作为提要构建 ASPNET5 应用程序?按照以下步骤操作:https://msdn.microsoft.com/Library/vs/alm/Build/azure/deploy-aspnet5 我可以看到脚本正在恢复,但它总是在我的本地包上出错。我确定我配置有问题。这是我尝试过的:
- 将带有 arg 的 Nuget 安装程序任务添加到我的解决方案和 NuGet 参数
nugete.exe -source "https://www.nuget.org/api/v2/;http://mynugetserver"(我尝试不包含 Nuget 参数,并在我的解决方案的根目录中包含 Nuget.config)。但是,构建遇到了一个异常,说它找不到本地 url:System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> System.Net.WebException: The remote name could not be resolved: 'mydomain'。好的,我明白了,但我可以让它识别本地 URL 吗? - 经过研究,我认为我必须使用 VSTS 的包管理器扩展。所以我在那里成功加载了我的包,但是当我在我的 Nuget.config 中包含该包 URL 时,我从
PreBuild.ps1收到了一堆未经授权的响应,因为它也在尝试查看 VSTS 包 URL。这就是我现在的位置。
当前 Nuget.Config
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageRestore>
<add key="enabled" value="True" />
<add key="automatic" value="True" />
</packageRestore>
<config>
<!--DO I NEED TO INCLUDE MY PROXY INFOR HERE I AM BEHIND ONE AT WORK-->
</config>
<bindingRedirects>
<add key="skip" value="False" />
</bindingRedirects>
<activePackageSource>
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
</activePackageSource>
<packageSources>
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
<add key="nuget.org" value="https://www.nuget.org/api/v2/" />
<add key="Local" value="https://vstsurl/DefaultCollection/_packaging/Local/nuget/v3/index.json" />
<add key="Company Nuget Gallery v2" value="http://mydomain/nuget/api/v2" />
</packageSources>
</configuration>
更新
如果我在 VSTS 上使用包管理器,这些都是警告/异常,它们似乎都来自本地提要。不知道为什么它对所有外部包都使用本地提要
System.Net.Http.HttpRequestException: Response status code does not indicate success: 401 (Unauthorized).
... other exceptions here
----------
Restore failed
【问题讨论】:
-
mydomain可以上网吗? -
这就是问题所在。 VSTS 服务器应该如何到达您的 Intranet?您需要在可访问互联网的地方发布提要
标签: asp.net nuget nuget-server azure-devops