Azure devops Azure管道:.NET Core 3.0:Can';不发表

Azure devops Azure管道:.NET Core 3.0:Can';不发表,azure-devops,azure-pipelines,.net-core-3.0,Azure Devops,Azure Pipelines,.net Core 3.0,我对Azure管道有问题。我正在尝试构建一个ASP.NET Core 3.0项目。是的,我知道它还不受支持,但是其他人说您可以通过在管道脚本中包含以下内容来实现。然而,我不知道如何做到这一点 任务:DotNetCoreInstaller@0 displayName:“安装.net core 3.0(预览版)” 输入:版本:“3.0.100-preview6-012264” 我是否将上述内容粘贴到以下脚本中?如果没有,我会把它放在哪里?另外,我目前在预览9上,支持吗 # ASP.NET Cor

我对Azure管道有问题。我正在尝试构建一个ASP.NET Core 3.0项目。是的,我知道它还不受支持,但是其他人说您可以通过在管道脚本中包含以下内容来实现。然而,我不知道如何做到这一点

  • 任务:DotNetCoreInstaller@0
    displayName:“安装.net core 3.0(预览版)”
    输入:版本:“3.0.100-preview6-012264”
我是否将上述内容粘贴到以下脚本中?如果没有,我会把它放在哪里?另外,我目前在预览9上,支持吗

# ASP.NET Core
# Build and test ASP.NET Core projects targeting .NET Core.
# Add steps that run tests, create a NuGet package, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/dotnet-core

trigger:
- master

pool:
  vmImage: 'ubuntu-latest' 


variables:
  buildConfiguration: 'Release'

steps:
- script: dotnet build --configuration $(buildConfiguration)
  displayName: 'dotnet build $(buildConfiguration)'

您可能想使用
UseDotNet@2
任务。您可以将其添加到步骤列表中

这里有一个例子

- steps:

- task: UseDotNet@2
  displayName: 'Use .NET Core sdk'
  inputs:
    packageType: sdk
    version: 3.x
    includePreviewVersions: true
    installationPath: $(Agent.ToolsDirectory)/dotnet

- script: ... etc etc
  displayName: Continue as normal, now that the .net core 3.x SDK is installed.
是的,支持预览9。rc1也是如此。此步骤安装最新的3.x版本,并包括所有预览。发布后,如果需要,可以删除
includePreviewVersions
字段

有关更多信息,请参阅以下文档:

我是否将以下内容粘贴到下面的脚本中,或者将其放置在何处

您可以在步骤开始时粘贴以下脚本,如:

steps:
- task: UseDotNet@2
  displayName: 'Use .NET Core sdk 3.0.100-preview9-014004'
  inputs:
    version: '3.0.100-preview9-014004'
    includePreviewVersions: true

- task: dotnet build --configuration $(buildConfiguration)
  displayName: 'dotnet build $(buildConfiguration)'
  ...
您可以通过在搜索框中搜索
use.net core
来获得它:

我目前在预览9上,这是否支持它

答案是肯定的。此任务用于安装支持.NET core 3.0预览的.NET SDK

作为测试结果:


希望这有帮助。

当我看最右边的任务列表时,我没有看到这个任务。试着把它添加到YAML中,直接感谢Leo的详细回答。我不知道为什么它被否决了,但是谢谢。u@rogue39nin随时我也不知道谁投了反对票。有些人可能对这个问题有一些误解。不管怎样,不要太担心。