UseDotNet@2 任务是否安装 Hosting Bundle?

Does the UseDotNet@2 task install the Hosting Bundle?

试图了解 UseDotnet@2 任务对 Asp.Net 核心托管包的作用。当我使用这个时:

    - task: UseDotNet@2
      inputs:
        packageType: sdk
        version: 3.1.x

我在注册表中看到“Microsoft .NET Core 3.1.5 - Windows 服务器托管 (x86)”,但我的应用程序似乎需要“Microsoft .NET Core 3.1.8 - Windows Server Hosting (x86)”(我预计它会安装,因为它是与 3.1.4 的 sdk 关联的版本,根据 https://dotnet.microsoft.com/download/dotnet-core/3.1

有人可以说明 UseDotnet 任务将安装哪个版本的托管包吗?

我需要使用这个第三方任务而不是 UseDotNet@2 https://marketplace.visualstudio.com/items?itemName=rbosma.InstallNetCoreRuntimeAndHosting

我在 UseDotnet@2 任务的 source code 中搜索,但没有找到下载托管包的脚本,只有下载 .net Core 运行时的脚本。

因此,如果有托管包,它可能已经在代理中。

在Microsoft-hostedWindowsagent中,虽然没有直接证据表明安装了hosting Bundle,但安装了一些.net Core runtime版本。

对于 Windows 服务器 2019 和 Visual Studio 2019(windows-latestwindows-2019),单击 this link 了解详细信息。

对于 Windows Server 2016 和 Visual Studio 2017 (vs2017-win2016),单击 this link 了解详细信息。

由于 .net Core 运行时是托管包的一部分,我认为“Microsoft .NET Core 3.1.5 - Windows 服务器托管 (x86)”可能与已安装的这些运行时版本有关

此外,您可以使用 UseDotnet@2 任务来阐明或安装特定的 .net Core Runtime 版本。

这是一个例子:

- task: UseDotNet@2
  inputs:
    packageType: 'runtime'
    version: '3.1.8'