You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何为自定义Nuget仓库配置Nuget.config解决App Center构建失败问题

问题根因

你当前的配置存在两个核心问题,直接导致App Center构建失败:

  1. 你填写的Infragistics包源是本地localhost地址,仅能在你自己的开发设备上访问,App Center的远程构建服务器无法连接到你本地的8624端口服务
  2. 你移除了Nuget.org官方源,导致Xamarin.Forms这类公共依赖包没有合法的拉取渠道

修复步骤

  • 首先调整Nuget.config配置,替换本地Infragistics源为官方公网源,同时恢复Nuget.org官方源,参考配置如下:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <packageSources>
    <add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
    <add key="Infragistics" value="https://packages.infragistics.com/nuget/licensed/" />
  </packageSources>
</configuration>
  • 若你需要限制不同包的拉取源避免混乱,可添加包源映射配置:
<configuration>
  <!-- 上面已有的packageSources配置保持不变 -->
  <packageSourceMapping>
    <packageSource key="nuget.org">
      <package pattern="*" />
    </packageSource>
    <packageSource key="Infragistics">
      <package pattern="Infragistics.*" />
    </packageSource>
  </packageSourceMapping>
</configuration>
  • 接下来在App Center的构建配置中,添加Infragistics官方源的访问凭证:你可以在App Center构建页的环境变量中配置对应源的用户名和授权密钥,也可以将加密后的凭证信息写入Nuget.config后提交到代码仓库
  • 如果你坚持使用自建的Infragistics私有源,需要将源服务部署到公网可访问的地址,同时给App Center的构建IP段开通访问权限,再将Nuget.config中的源地址替换为公网可访问的地址即可
  • 最后提交修改后的Nuget.config到代码仓库,触发重新构建即可

内容的提问来源于stack exchange,提问作者MikiBelavista

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.10.03 13:57:05