NuGet.org のアップストリーム ソース

Azure DevOps Services | Azure DevOps Server 2020 | Azure DevOps Server 2019 | TFS 2018

フィードでアップストリーム ソースを有効にすると、開発者は nuget.org や npmjs.com などのパブリック レジストリからパッケージを使用できます。 この記事では、NuGet ギャラリーのアップストリーム ソースを追加して、nuget.org パブリック レジストリから NuGet パッケージを使用する方法について説明します。

  1. [Artifacts] を選択し、フィードを選択します。

  2. 歯車アイコン gear icon ボタンを選択して、[ フィード設定] に移動します。

  3. [アップストリーム ソース] を選択します。

    A screenshot showing how to access upstream sources from feed settings.

  4. [ アップストリームの追加] を選択します。

    A screenshot showing how to add an upstream source.

  5. [ パブリック ソース] を選択します。

    Screenshot showing how to add a new upstream source.

  6. ドロップダウン メニューから [ギャラリー NuGet選択します。 完了したら 、[保存] を選択します

    Screenshot showing how to add the nuget.org upstream source.

    注意

    nuget.org のサービス インデックスの場所は次の値です https://api.nuget.org/v3/index.json

  7. 右上隅にある [保存] を選択して変更を保存します。

nuget.configの更新

  1. [Artifacts] を選択し、フィードを選択します。

  2. フィードするConnectを選択し、[NuGet.exe] を選択します。

    A screenshot showing how to connect to NuGet feeds.

  3. [Project セットアップ] セクションで XML スニペットをコピーします。

    <?xml version="1.0" encoding="utf-8"?>
    <configuration>
      <packageSources>
        <clear />
        <add key="<FEED_NAME>" value="https://pkgs.dev.azure.com/<ORGANIZATION_NAME>/_packaging/<FEED_NAME>/nuget/v3/index.json" />
      </packageSources>
    </configuration>
    
  4. プロジェクトのルートに新しい nuget.config ファイルを作成します。

  5. nuget.config ファイルに XML スニペットを貼り付けます。

保存されたパッケージを表示する

ドロップダウン メニューから [ソース] を選択すると、NuGet ギャラリーから保存したパッケージを表示できます。

A screenshot showing how to filter packages by source.

A screenshot showing how to filter packages by source in TFS