¿Cómo me aseguro de que DotNet Core correcto se incluya en la compilación?

Estoy tratando de implementar una .netcore 2.1.5 api en Windows 2012 Server R2

Actualmente mi sitio de API publicado muestra el siguiente error cuando navego a él

HTTP Error 502.5 - Process Failure

Common causes of this issue:
The application process failed to start
The application process started but then stopped
The application process started but failed to listen on the configured port

Troubleshooting steps:
Check the system event log for error messages
Enable logging the application process' stdout messages
Attach a debugger to the application process and inspect

For more information visit: https://go.microsoft.com/fwlink/?LinkID=808681

En el registro de eventos puedo ver

Event 1000, IIS AspNetCore Module
Application 'MACHINE/WEBROOT/APPHOST/MYSITE.COM.AU/MYAPINAME' with physical root 'C:\WebSites\MYSITE.COM.AU\MyApps\MYAPINAME\' failed to start process
commandline '.\dotnet .\mydllname.dll', ErrorCode='0x80004005 : 80008083

Desdeesta pregunt

Veo que puedo incluir

 <PublishWithAspNetCoreTargetManifest>False</PublishWithAspNetCoreTargetManifest>

En el perfil de publicación Si quiero asegurarme de que la versión correcta de DotNetCore se instala en la computadora host.

Pero, ¿cómo configuro eso si quiero usar Azure Devops?

Intenté comprobar Publicar proyectos web en la tarea Publicar

pero luego recibo un error

No web project was found in the repository. Web projects are identified by 
presence of either a web.config file or wwwroot folder in the directory.

No se encontraron archivos del proyecto que coincidan con el patrón especificado.

Las dependencias incluyen

Microsoft.AspNetCore.App 2.1.5  

pero no veo un dll correspondiente desplegado.

Intenté instalar dotnet-runtime-2.1.5 en la computadora, descargado deel sitio del instalador

[Actualizar

Noté que faltaba la carpeta de registros, así que la creé manualmente

[Actualizar

Agregué la tarea sugerida por Eriawan. El YAML es

    steps:
- task: DotNetCoreInstaller@0
  displayName: 'Use .NET Core sdk 2.1.5'
  inputs:
    version: 2.1.5

Me meto en el registro

2018-10-29T08:29:05.4839748Z ##[section]Starting: Use .NET Core sdk 2.1.5
2018-10-29T08:29:05.4843909Z ==============================================================================
2018-10-29T08:29:05.4843981Z Task         : .NET Core Tool Installer
2018-10-29T08:29:05.4844041Z Description  : Acquires a specific version of .NET Core from internet or the tools cache and adds it to the PATH. Use this task to change the version of .NET Core used in subsequent tasks.
2018-10-29T08:29:05.4844089Z Version      : 0.1.16
2018-10-29T08:29:05.4844134Z Author       : Microsoft Corporation
2018-10-29T08:29:05.4844192Z Help         : [More Information](https://go.microsoft.com/fwlink/?linkid=853651)
2018-10-29T08:29:05.4844234Z ==============================================================================
2018-10-29T08:29:05.9812262Z Tool to install: .NET Core sdk version 2.1.5.
2018-10-29T08:29:05.9825645Z Checking if a cached copy exists for this version...
2018-10-29T08:29:05.9830151Z Cache does not contains this particular .NET Core. Will be downloaded and installed.
2018-10-29T08:29:05.9833458Z Detected platform (Primary): win-x64
2018-10-29T08:29:05.9833723Z Getting URL to download .NET Core sdk version: 2.1.5.
2018-10-29T08:29:06.5248134Z Could not fetch download information for version 2.1.5. Please check if the version specified is correct. You can refer the link for supported versions => https://github.com/dotnet/core/blob/master/release-notes/releases.json. Falling back to creating convention based URL.
2018-10-29T08:29:06.5481883Z [command]C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -NoLogo -Sta -NoProfile -NonInteractive -ExecutionPolicy Unrestricted -Command "& 'D:\a\_tasks\DotNetCoreInstaller_b0ce7256-7898-45d3-9cb5-176b752bfea6\0.1.16\externals\install-dotnet.ps1' -Version 2.1.5 -DryRun"
2018-10-29T08:29:07.6386710Z dotnet-install: Payload URLs:
2018-10-29T08:29:07.6387117Z dotnet-install: Primary - https://dotnetcli.azureedge.net/dotnet/Sdk/2.1.5/dotnet-sdk-2.1.5-win-x64.zip
2018-10-29T08:29:07.6387245Z dotnet-install: Legacy - https://dotnetcli.azureedge.net/dotnet/Sdk/2.1.5/dotnet-dev-win-x64.2.1.5.zip
2018-10-29T08:29:07.6387445Z dotnet-install: Repeatable invocation: .\install-dotnet.ps1 -Version 2.1.5 -Channel LTS -Architecture x64 -InstallDir <auto>
2018-10-29T08:29:07.6451802Z Downloading: https://dotnetcli.azureedge.net/dotnet/Sdk/2.1.5/dotnet-sdk-2.1.5-win-x64.zip
2018-10-29T08:29:08.8792388Z ##[warning]Could not download installation package from this URL: https://dotnetcli.azureedge.net/dotnet/Sdk/2.1.5/dotnet-sdk-2.1.5-win-x64.zip Error: {}
2018-10-29T08:29:08.8807163Z Downloading: https://dotnetcli.azureedge.net/dotnet/Sdk/2.1.5/dotnet-dev-win-x64.2.1.5.zip
2018-10-29T08:29:09.5450400Z ##[warning]Could not download installation package from this URL: https://dotnetcli.azureedge.net/dotnet/Sdk/2.1.5/dotnet-dev-win-x64.2.1.5.zip Error: {}
2018-10-29T08:29:09.5453128Z ##[error]Failed to download package for installation
2018-10-29T08:29:09.5551776Z ##[section]Finishing: Use .NET Core sdk 2.1.5

El diseñador muestra

The csproj es

    <Project Sdk="Microsoft.NET.Sdk.Web">

  <PropertyGroup>
    <TargetFramework>netcoreapp2.1</TargetFramework>
           <ApplicationIcon />
    <OutputType>Exe</OutputType>
    <StartupObject />
  </PropertyGroup>

  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
    <DocumentationFile>bin\Debug\netcoreapp2.1\trackApi.xml</DocumentationFile>
    <DefineConstants>TRACE;DEBUG;NETCOREAPP2_1</DefineConstants>
  </PropertyGroup>

  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
    <DocumentationFile>bin\Release\netcoreapp2.1\trackApi.xml</DocumentationFile>
  </PropertyGroup>

  <ItemGroup>
    <Folder Include="logs\" />
    <Folder Include="Views\Account\" />
    <Folder Include="wwwroot\" />
  </ItemGroup>

  <ItemGroup>
    <DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="2.0.3" />
  </ItemGroup>

  <ItemGroup>
    <PackageReference Include="Microsoft.AspNetCore.App" Version="2.1.5" />
    <PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="2.1.5" />
    <PackageReference Include="Serilog.Extensions.Logging" Version="2.0.2" />
    <PackageReference Include="Serilog.Sinks.Console" Version="3.1.1" />
    <PackageReference Include="Serilog.Sinks.RollingFile" Version="3.3.0" />
    <PackageReference Include="Swashbuckle.AspNetCore" Version="3.0.0" />
  </ItemGroup>

  <ItemGroup>
    <Content Update="appsettings.json">
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </Content>
  </ItemGroup>

</Project>

[Actualizar

problemas en la tubería de compilación

[Actualizar

Creé una nueva tubería usando YAML

pool:
  vmImage: 'VS2017-Win2016'

variables:
  buildConfiguration: 'Debug'

steps:
- task: DotNetCoreInstaller@0
  displayName: 'Use .NET Core sdk 2.1.5'
  inputs:
    version: 2.1.5


- task: DotNetCoreCLI@2
  displayName: Restore
  inputs:
    command: restore

    projects: '**/Api*.csproj'

Sin embargo, todavía recibo un error

018-10-29T09:36:13.7155347Z ##[section]Starting: Use .NET Core sdk 2.1.5
2018-10-29T09:36:13.7158688Z ==============================================================================
2018-10-29T09:36:13.7158742Z Task         : .NET Core Tool Installer
2018-10-29T09:36:13.7158774Z Description  : Acquires a specific version of .NET Core from internet or the tools cache and adds it to the PATH. Use this task to change the version of .NET Core used in subsequent tasks.
2018-10-29T09:36:13.7158842Z Version      : 0.1.16
2018-10-29T09:36:13.7158878Z Author       : Microsoft Corporation
2018-10-29T09:36:13.7158926Z Help         : [More Information](https://go.microsoft.com/fwlink/?linkid=853651)
2018-10-29T09:36:13.7158958Z ==============================================================================
2018-10-29T09:36:14.1220877Z Tool to install: .NET Core sdk version 2.1.5.
2018-10-29T09:36:14.1231419Z Checking if a cached copy exists for this version...
2018-10-29T09:36:14.1238258Z Cache does not contains this particular .NET Core. Will be downloaded and installed.
2018-10-29T09:36:14.1240864Z Detected platform (Primary): win-x64
2018-10-29T09:36:14.1240993Z Getting URL to download .NET Core sdk version: 2.1.5.
2018-10-29T09:36:14.5706519Z Could not fetch download information for version 2.1.5. Please check if the version specified is correct. You can refer the link for supported versions => https://github.com/dotnet/core/blob/master/release-notes/releases.json. Falling back to creating convention based URL.
2018-10-29T09:36:14.5957734Z [command]C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -NoLogo -Sta -NoProfile -NonInteractive -ExecutionPolicy Unrestricted -Command "& 'D:\a\_tasks\DotNetCoreInstaller_b0ce7256-7898-45d3-9cb5-176b752bfea6\0.1.16\externals\install-dotnet.ps1' -Version 2.1.5 -DryRun"
2018-10-29T09:36:15.3109409Z dotnet-install: Payload URLs:
2018-10-29T09:36:15.3109790Z dotnet-install: Primary - https://dotnetcli.azureedge.net/dotnet/Sdk/2.1.5/dotnet-sdk-2.1.5-win-x64.zip
2018-10-29T09:36:15.3109942Z dotnet-install: Legacy - https://dotnetcli.azureedge.net/dotnet/Sdk/2.1.5/dotnet-dev-win-x64.2.1.5.zip
2018-10-29T09:36:15.3110089Z dotnet-install: Repeatable invocation: .\install-dotnet.ps1 -Version 2.1.5 -Channel LTS -Architecture x64 -InstallDir <auto>
2018-10-29T09:36:15.3188675Z Downloading: https://dotnetcli.azureedge.net/dotnet/Sdk/2.1.5/dotnet-sdk-2.1.5-win-x64.zip
2018-10-29T09:36:16.5236693Z ##[warning]Could not download installation package from this URL: https://dotnetcli.azureedge.net/dotnet/Sdk/2.1.5/dotnet-sdk-2.1.5-win-x64.zip Error: {}
2018-10-29T09:36:16.5256084Z Downloading: https://dotnetcli.azureedge.net/dotnet/Sdk/2.1.5/dotnet-dev-win-x64.2.1.5.zip
2018-10-29T09:36:17.2185860Z ##[warning]Could not download installation package from this URL: https://dotnetcli.azureedge.net/dotnet/Sdk/2.1.5/dotnet-dev-win-x64.2.1.5.zip Error: {}
2018-10-29T09:36:17.2189408Z ##[error]Failed to download package for installation
2018-10-29T09:36:17.2271136Z ##[section]Finishing: Use .NET Core sdk 2.1.5

The urlhttps: //dotnetcli.azureedge.net/dotnet/Sdk/2.1.5/dotnet-dev-win-x64.2.1.5.zi muestra un error

This XML file does not appear to have any style information associated with it. The document tree is shown below.
<Error>
<Code>BlobNotFound</Code>
<Message>
The specified blob does not exist. RequestId:7447502f-301e-00a8-516d-6f7cde000000 Time:2018-10-29T09:57:58.4200303Z
</Message>
</Error>

[Actualizar

Eriawan tiene la respuesta. Necesitaba usar una tubería YAML y obtener la versión aquí. @

Respuestas a la pregunta(1)

Su respuesta a la pregunta