使用多个包服务器部署到 Azure 网站
Deploying to Azure Web Site using multiple package servers
我已经在 Azure 上建立了一个网站,通过 TFS 存储库进行部署。该过程在尝试安装存储在 myGet nuget 服务器而非 nuget.org 上的 nuget 包时失败。我已按照 link 在与我的解决方案文件相同的文件夹中添加(并签入 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\Nuget\tempNuGet_59.config
Feeds used:
https://api.nuget.org/v3/index.json
Installed:
100 package(s) to D:\a\s\Scrubber\Scrubber.csproj
132 package(s) to D:\a\s\Scrubber.UnitTest\Scrubber.UnitTest.csproj
9 package(s) to D:\a\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\s\Scrubber.UnitTest\Scrubber.UnitTest.csproj" (Restore target(s)) -- FAILED.
Build FAILED.
"D:\a\s\Scrubber.UnitTest\Scrubber.UnitTest.csproj" (Restore target) (1) ->
(Restore target) ->
D:\a\s\Scrubber\Scrubber.csproj : error NU1102: Unable to find package AspNet.Security.OAuth.Instagram with version (>= 2.1.0) [D:\a\s\Scrubber.UnitTest\Scrubber.UnitTest.csproj]
D:\a\s\Scrubber\Scrubber.csproj : error NU1102: - Found 11 version(s) in nuget.org [ Nearest version: 2.0.1 ] [D:\a\s\Scrubber.UnitTest\Scrubber.UnitTest.csproj]
D:\a\s\Scrubber\Scrubber.csproj : error NU1102: Unable to find package AspNet.Security.OAuth.Reddit with version (>= 2.1.0) [D:\a\s\Scrubber.UnitTest\Scrubber.UnitTest.csproj]
D:\a\s\Scrubber\Scrubber.csproj : error NU1102: - Found 13 version(s) in nuget.org [ Nearest version: 2.0.1 ] [D:\a\s\Scrubber.UnitTest\Scrubber.UnitTest.csproj]
D:\a\s\Scrubber\Scrubber.csproj : error NU1102: Unable to find package AspNet.Security.OAuth.GitHub with version (>= 2.1.0) [D:\a\s\Scrubber.UnitTest\Scrubber.UnitTest.csproj]
D:\a\s\Scrubber\Scrubber.csproj : error NU1102: - Found 14 version(s) in nuget.org [ Nearest version: 2.0.1 ] [D:\a\s\Scrubber.UnitTest\Scrubber.UnitTest.csproj]
D:\a\s\Scrubber\Scrubber.csproj : error NU1102: Unable to find package AspNet.Security.OAuth.LinkedIn with version (>= 2.1.0) [D:\a\s\Scrubber.UnitTest\Scrubber.UnitTest.csproj]
D:\a\s\Scrubber\Scrubber.csproj : error NU1102: - Found 14 version(s) in nuget.org [ Nearest version: 2.0.1 ] [D:\a\s\Scrubber.UnitTest\Scrubber.UnitTest.csproj]
D:\a\s\Scrubber.UnitTest\Scrubber.UnitTest.csproj : error NU1102: Unable to find package AspNet.Security.OAuth.Instagram with version (>= 2.1.0)
D:\a\s\Scrubber.UnitTest\Scrubber.UnitTest.csproj : error NU1102: - Found 11 version(s) in nuget.org [ Nearest version: 2.0.1 ]
D:\a\s\Scrubber.UnitTest\Scrubber.UnitTest.csproj : error NU1102: Unable to find package AspNet.Security.OAuth.Reddit with version (>= 2.1.0)
D:\a\s\Scrubber.UnitTest\Scrubber.UnitTest.csproj : error NU1102: - Found 13 version(s) in nuget.org [ Nearest version: 2.0.1 ]
D:\a\s\Scrubber.UnitTest\Scrubber.UnitTest.csproj : error NU1102: Unable to find package AspNet.Security.OAuth.GitHub with version (>= 2.1.0)
D:\a\s\Scrubber.UnitTest\Scrubber.UnitTest.csproj : error NU1102: - Found 14 version(s) in nuget.org [ Nearest version: 2.0.1 ]
D:\a\s\Scrubber.UnitTest\Scrubber.UnitTest.csproj : error NU1102: Unable to find package AspNet.Security.OAuth.LinkedIn with version (>= 2.1.0)
D:\a\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)
Deploying to Azure Web Site using multiple package servers
您是否已在您的 Azure Devops 帐户上添加到 MyGet 的服务连接?如果不行,您可以尝试添加服务连接到MyGet。
然后 select 基本身份验证作为身份验证方法:
在管道上使用还原 nuget 包时使用该凭据:
查看文档 Visual Studio Team Services Integration 了解更多详细信息。
希望对您有所帮助
我已经在 Azure 上建立了一个网站,通过 TFS 存储库进行部署。该过程在尝试安装存储在 myGet nuget 服务器而非 nuget.org 上的 nuget 包时失败。我已按照
我缺少什么以便 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\Nuget\tempNuGet_59.config
Feeds used:
https://api.nuget.org/v3/index.json
Installed:
100 package(s) to D:\a\s\Scrubber\Scrubber.csproj
132 package(s) to D:\a\s\Scrubber.UnitTest\Scrubber.UnitTest.csproj
9 package(s) to D:\a\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\s\Scrubber.UnitTest\Scrubber.UnitTest.csproj" (Restore target(s)) -- FAILED.
Build FAILED.
"D:\a\s\Scrubber.UnitTest\Scrubber.UnitTest.csproj" (Restore target) (1) ->
(Restore target) ->
D:\a\s\Scrubber\Scrubber.csproj : error NU1102: Unable to find package AspNet.Security.OAuth.Instagram with version (>= 2.1.0) [D:\a\s\Scrubber.UnitTest\Scrubber.UnitTest.csproj]
D:\a\s\Scrubber\Scrubber.csproj : error NU1102: - Found 11 version(s) in nuget.org [ Nearest version: 2.0.1 ] [D:\a\s\Scrubber.UnitTest\Scrubber.UnitTest.csproj]
D:\a\s\Scrubber\Scrubber.csproj : error NU1102: Unable to find package AspNet.Security.OAuth.Reddit with version (>= 2.1.0) [D:\a\s\Scrubber.UnitTest\Scrubber.UnitTest.csproj]
D:\a\s\Scrubber\Scrubber.csproj : error NU1102: - Found 13 version(s) in nuget.org [ Nearest version: 2.0.1 ] [D:\a\s\Scrubber.UnitTest\Scrubber.UnitTest.csproj]
D:\a\s\Scrubber\Scrubber.csproj : error NU1102: Unable to find package AspNet.Security.OAuth.GitHub with version (>= 2.1.0) [D:\a\s\Scrubber.UnitTest\Scrubber.UnitTest.csproj]
D:\a\s\Scrubber\Scrubber.csproj : error NU1102: - Found 14 version(s) in nuget.org [ Nearest version: 2.0.1 ] [D:\a\s\Scrubber.UnitTest\Scrubber.UnitTest.csproj]
D:\a\s\Scrubber\Scrubber.csproj : error NU1102: Unable to find package AspNet.Security.OAuth.LinkedIn with version (>= 2.1.0) [D:\a\s\Scrubber.UnitTest\Scrubber.UnitTest.csproj]
D:\a\s\Scrubber\Scrubber.csproj : error NU1102: - Found 14 version(s) in nuget.org [ Nearest version: 2.0.1 ] [D:\a\s\Scrubber.UnitTest\Scrubber.UnitTest.csproj]
D:\a\s\Scrubber.UnitTest\Scrubber.UnitTest.csproj : error NU1102: Unable to find package AspNet.Security.OAuth.Instagram with version (>= 2.1.0)
D:\a\s\Scrubber.UnitTest\Scrubber.UnitTest.csproj : error NU1102: - Found 11 version(s) in nuget.org [ Nearest version: 2.0.1 ]
D:\a\s\Scrubber.UnitTest\Scrubber.UnitTest.csproj : error NU1102: Unable to find package AspNet.Security.OAuth.Reddit with version (>= 2.1.0)
D:\a\s\Scrubber.UnitTest\Scrubber.UnitTest.csproj : error NU1102: - Found 13 version(s) in nuget.org [ Nearest version: 2.0.1 ]
D:\a\s\Scrubber.UnitTest\Scrubber.UnitTest.csproj : error NU1102: Unable to find package AspNet.Security.OAuth.GitHub with version (>= 2.1.0)
D:\a\s\Scrubber.UnitTest\Scrubber.UnitTest.csproj : error NU1102: - Found 14 version(s) in nuget.org [ Nearest version: 2.0.1 ]
D:\a\s\Scrubber.UnitTest\Scrubber.UnitTest.csproj : error NU1102: Unable to find package AspNet.Security.OAuth.LinkedIn with version (>= 2.1.0)
D:\a\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)
Deploying to Azure Web Site using multiple package servers
您是否已在您的 Azure Devops 帐户上添加到 MyGet 的服务连接?如果不行,您可以尝试添加服务连接到MyGet。
然后 select 基本身份验证作为身份验证方法:
在管道上使用还原 nuget 包时使用该凭据:
查看文档 Visual Studio Team Services Integration 了解更多详细信息。
希望对您有所帮助