0

カスタムパッケージソースを持つ.net core 2.0 webapiのnugetパッケージを復元する際の問題を解決しようとしています。カスタムnuget.configを使用したwebappでnugetパッケージのリストアが失敗する

基本的にnuget.configを含めると、私のナゲットリファレンスを無視するように見えるため、Microsoftパッケージがインストールに失敗します。

カスタムnuget.configを削除する回避策を見つけました。ビルドに失敗しました。失敗すると、nuget.orgから適切なものをダウンロードしてから、カスタムファイルを追加して戻します。それらのmicrosoftパッケージをディスクから復元し、リーチアウトしてカスタムナゲットパッケージを入手します。

マイnugetパッケージの設定は次のようになります。

<?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="ASPNET Team" value="https://dotnet.myget.org/F/aspnetcore-ci-dev/api/v3/index.json" /> 
    <add key="OTL" value="https://www.myget.org/F/{redacted}/api/v3/index.json" /> 
    </packageSources> 
    <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> 
    <disabledPackageSources /> 
</configuration> 

クーズーからのエラーは、次のとおりです。

An error occurred while sending the request. 
    A connection with the server could not be established 
    Retrying 'FindPackagesByIdAsync' for source 'https://www.myget.org/F/{redacted}/api/v3/flatcontainer/microsoft.extensions.caching.sqlserver/index.json'. 
    An error occurred while sending the request. 
    A connection with the server could not be established 
    Retrying 'FindPackagesByIdAsync' for source 'https://dotnetmyget.blob.core.windows.net/artifacts/aspnetcore-ci-dev/nuget/v3/flatcontainer/microsoft.extensions.hosting.abstractions/index.json'. 
    An error occurred while sending the request. 
    A connection with the server could not be established 
    Retrying 'FindPackagesByIdAsync' for source 'https://dotnetmyget.blob.core.windows.net/artifacts/aspnetcore-ci-dev/nuget/v3/flatcontainer/microsoft.extensions.caching.sqlserver/index.json'. 
    An error occurred while sending the request. 
    A connection with the server could not be established 
    Retrying 'FindPackagesByIdAsync' for source 'https://dotnetmyget.blob.core.windows.net/artifacts/aspnetcore-ci-dev/nuget/v3/flatcontainer/microsoft.entityframeworkcore.tools/index.json'. 
    An error occurred while sending the request. 
    A connection with the server could not be established 
    Retrying 'FindPackagesByIdAsync' for source 'https://www.myget.org/F/{redacted}/api/v3/flatcontainer/microsoft.extensions.dependencyinjection.abstractions/index.json'. 
    An error occurred while sending the request. 
    A connection with the server could not be established 
    Retrying 'FindPackagesByIdAsync' for source 'https://dotnetmyget.blob.core.windows.net/artifacts/aspnetcore-ci-dev/nuget/v3/flatcontainer/microsoft.extensions.dependencyinjection.abstractions/index.json'. 
    An error occurred while sending the request. 
    A connection with the server could not be established 
    Retrying 'FindPackagesByIdAsync' for source 'https://www.myget.org/F/{redacted}/api/v3/flatcontainer/microsoft.extensions.caching.sqlserver/index.json'. 

はクーズーコンソールから直接復元DOTNETをやっても同じ結果が得られます。私はNuGet.configを私の開発マシンから引き出しました。私が知っているのは、マイクロソフトのパッケージとカスタムパッケージの両方を正常に復元し、それを使用しようとしましたが、それでも失敗しました。

私はアウトバウンドポートがファイアウォールを空白の中でブロックしていると思っていますが、Webapp上のアウトバウンドファイアウォールやプロキシのグーグルは実りありませんでした。

+0

CI/CDを使用していますか?この問題を絞り込むために[NuGetの動作の設定](https://docs.microsoft.com/en-us/nuget/consume-packages/configuring-nuget-behavior)にチェックしましたか? –

+0

私はgithubからCDを使用しています。マスターが更新されると、ビルドされます。私のnuget.Configは明らかにURLからのURLを入力しているので動作していますが、何も関係なく接続します。 – willthiswork89

答えて

0

したがって、KuduチームとNugetチームを調査して、Azure WebAppsの基本スレッドとフリースレッドのスレッド数が制限されていることが判明しました。また、Nugetの復元が並列非同期式で行われると、スレッドにヒットします制限し、失敗する。

修正するには、ドットネットリストアで--disable-parallelを使用してカスタム配備スクリプトを配備する必要があります。

関連する問題