Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/mercurial/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用多个包服务器部署到Azure网站_Azure_Asp.net Core_Azure Devops_Nuget_Myget - Fatal编程技术网

使用多个包服务器部署到Azure网站

使用多个包服务器部署到Azure网站,azure,asp.net-core,azure-devops,nuget,myget,Azure,Asp.net Core,Azure Devops,Nuget,Myget,我已经在Azure上建立了一个网站,通过TFS存储库进行部署。当进程尝试安装存储在myGet nuget服务器(而不是nuget.org)上的nuget包时,该进程失败。根据链接,我已在与解决方案文件相同的文件夹中添加(并签入TFS)一个nuget.config文件 为了Azure能够恢复这些包,我缺少了什么 nuget.config: <?xml version="1.0" encoding="utf-8"?> <configuration> <activeP

我已经在Azure上建立了一个网站,通过TFS存储库进行部署。当进程尝试安装存储在myGet nuget服务器(而不是nuget.org)上的nuget包时,该进程失败。根据链接,我已在与解决方案文件相同的文件夹中添加(并签入TFS)一个nuget.config文件

为了Azure能够恢复这些包,我缺少了什么

nuget.config:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <activePackageSource>
  <add key="All" value="(Aggregate source)" />
</activePackageSource>
  <packageSources>
    <add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
    <add key="Syncfusion ASP.NET Core NuGet Package feed URL" value="http://nuget.syncfusion.com/nuget_aspnetcore/nuget/getsyncfusionpackages/aspnetcore" />
    <add key="MyGet" value="https://www.myget.org/F/aspnet-contrib/api/v3/index.json" />
  </packageSources>
<disabledPackageSources />
  <packageRestore>
    <add key="enabled" value="True" />
    <add key="automatic" value="True" />
  </packageRestore>
  <bindingRedirects>
    <add key="skip" value="False" />
  </bindingRedirects>
  <packageManagement>
    <add key="format" value="0" />
    <add key="disabled" value="False" />
  </packageManagement>
</configuration>
 NuGet Config files used:
             D:\a\3\Nuget\tempNuGet_59.config

         Feeds used:
             https://api.nuget.org/v3/index.json

         Installed:
             100 package(s) to D:\a\3\s\Scrubber\Scrubber.csproj
             132 package(s) to D:\a\3\s\Scrubber.UnitTest\Scrubber.UnitTest.csproj
             9 package(s) to D:\a\3\s\SimplerProducts.MicrosoftEntityFrameworkCoreStorage\SimplerProducts.MicrosoftEntityFrameworkCoreStorage.csproj
       Done executing task "RestoreTask" -- FAILED.
     1>Done building target "Restore" in project "Scrubber.UnitTest.csproj" -- FAILED.
     1>Done Building Project "D:\a\3\s\Scrubber.UnitTest\Scrubber.UnitTest.csproj" (Restore target(s)) -- FAILED.

Build FAILED.

       "D:\a\3\s\Scrubber.UnitTest\Scrubber.UnitTest.csproj" (Restore target) (1) ->
       (Restore target) -> 
         D:\a\3\s\Scrubber\Scrubber.csproj : error NU1102: Unable to find package AspNet.Security.OAuth.Instagram with version (>= 2.1.0) [D:\a\3\s\Scrubber.UnitTest\Scrubber.UnitTest.csproj]
       D:\a\3\s\Scrubber\Scrubber.csproj : error NU1102:   - Found 11 version(s) in nuget.org [ Nearest version: 2.0.1 ] [D:\a\3\s\Scrubber.UnitTest\Scrubber.UnitTest.csproj]
         D:\a\3\s\Scrubber\Scrubber.csproj : error NU1102: Unable to find package AspNet.Security.OAuth.Reddit with version (>= 2.1.0) [D:\a\3\s\Scrubber.UnitTest\Scrubber.UnitTest.csproj]
       D:\a\3\s\Scrubber\Scrubber.csproj : error NU1102:   - Found 13 version(s) in nuget.org [ Nearest version: 2.0.1 ] [D:\a\3\s\Scrubber.UnitTest\Scrubber.UnitTest.csproj]
         D:\a\3\s\Scrubber\Scrubber.csproj : error NU1102: Unable to find package AspNet.Security.OAuth.GitHub with version (>= 2.1.0) [D:\a\3\s\Scrubber.UnitTest\Scrubber.UnitTest.csproj]
       D:\a\3\s\Scrubber\Scrubber.csproj : error NU1102:   - Found 14 version(s) in nuget.org [ Nearest version: 2.0.1 ] [D:\a\3\s\Scrubber.UnitTest\Scrubber.UnitTest.csproj]
         D:\a\3\s\Scrubber\Scrubber.csproj : error NU1102: Unable to find package AspNet.Security.OAuth.LinkedIn with version (>= 2.1.0) [D:\a\3\s\Scrubber.UnitTest\Scrubber.UnitTest.csproj]
       D:\a\3\s\Scrubber\Scrubber.csproj : error NU1102:   - Found 14 version(s) in nuget.org [ Nearest version: 2.0.1 ] [D:\a\3\s\Scrubber.UnitTest\Scrubber.UnitTest.csproj]
         D:\a\3\s\Scrubber.UnitTest\Scrubber.UnitTest.csproj : error NU1102: Unable to find package AspNet.Security.OAuth.Instagram with version (>= 2.1.0)
       D:\a\3\s\Scrubber.UnitTest\Scrubber.UnitTest.csproj : error NU1102:   - Found 11 version(s) in nuget.org [ Nearest version: 2.0.1 ]
         D:\a\3\s\Scrubber.UnitTest\Scrubber.UnitTest.csproj : error NU1102: Unable to find package AspNet.Security.OAuth.Reddit with version (>= 2.1.0)
       D:\a\3\s\Scrubber.UnitTest\Scrubber.UnitTest.csproj : error NU1102:   - Found 13 version(s) in nuget.org [ Nearest version: 2.0.1 ]
         D:\a\3\s\Scrubber.UnitTest\Scrubber.UnitTest.csproj : error NU1102: Unable to find package AspNet.Security.OAuth.GitHub with version (>= 2.1.0)
       D:\a\3\s\Scrubber.UnitTest\Scrubber.UnitTest.csproj : error NU1102:   - Found 14 version(s) in nuget.org [ Nearest version: 2.0.1 ]
         D:\a\3\s\Scrubber.UnitTest\Scrubber.UnitTest.csproj : error NU1102: Unable to find package AspNet.Security.OAuth.LinkedIn with version (>= 2.1.0)
       D:\a\3\s\Scrubber.UnitTest\Scrubber.UnitTest.csproj : error NU1102:   - Found 14 version(s) in nuget.org [ Nearest version: 2.0.1 ]

    0 Warning(s)
    8 Error(s)
使用多个包服务器部署到Azure网站

您是否已在Azure Devops帐户上向MyGet添加服务连接?如果没有,您可以尝试将服务连接添加到MyGet

然后选择基本身份验证作为身份验证方法:

并在管道上使用还原nuget包时使用该凭据:

查看文档以了解更多详细信息


希望这有助于

还原时会出现什么错误?它无法检测到nuget.config文件中的其他package manager位置。可能没有部署nuget.config文件。在“正常”详细程度下,nuget会输出它找到的所有nuget.config文件以及它使用的所有包源。检查输出,确保它找到了您的nuget.config并列出了您的包源。您可以从nuget.org/downloads下载nuget.exe,并从命令行运行
nuget restore whatever.sln
进行本地检查,这比每次要测试时触发CI服务器上的新生成更快。此问题已在将新库版本部署到nuget时得到解决(因此,TFS构建不需要联系MyGet包管理器)。在日志中,我看不到TFS是否在使用我的nuget.config文件的任何证据。@AjitGoel,感谢您在此处分享您的解决方法,您可以将其转换为答案,这样可以帮助其他社区成员解决同样的问题。根据get source的日志,您可以找到将nuget.config文件复制到tempNuGet_59.config文件的信息。日志显示了使用的提要:只有nuget.org,所以它不应该使用MyGet提要。