0

我在 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>

TFS 构建中的错误:

 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)
4

1 回答 1

1

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

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

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

在此处输入图像描述

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

在此处输入图像描述

查看文档Visual Studio Team Services Integration了解更多详细信息。

希望这可以帮助

于 2019-06-07T02:50:15.993 回答