Asp.net core azure管道中非预览asp.net core 3的最新版本

Asp.net core azure管道中非预览asp.net core 3的最新版本,asp.net-core,azure-pipelines,Asp.net Core,Azure Pipelines,在azure管道中安装.net core 3.0非预览版的命令是什么 我试过了 - task: DotNetCoreInstaller@0 displayName: 'Install .net core 3.0' inputs: packageType: 'sdk' version: '3.0.100' 而构建失败了 Getting URL to download .NET Core sdk version: 3.0.100. Could not fetch down

在azure管道中安装.net core 3.0非预览版的命令是什么

我试过了

- task: DotNetCoreInstaller@0
  displayName: 'Install .net core 3.0'
  inputs:
    packageType: 'sdk'
    version: '3.0.100'
而构建失败了

Getting URL to download .NET Core sdk version: 3.0.100.

Could not fetch download information for version 3.0.100. Please check if the version specified is correct. You can refer the link for supported versions => https://github.com/microsoft/azure-pipelines-tasks/blob/master/Tasks/DotNetCoreInstallerV0/externals/releases.json. Falling back to creating convention based URL.

##[warning]Kindly upgrade to new major version of this task 'Use .NET Core (2.*)' for installing newer versions of .NET Core. '0.*' task version might not be able to download newer .NET core versions. To know more about 'Use Dot Net (2.*)', refer https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/tool/dotnet-core-tool-installer?view=azure-devops. 3.0.100
在它起作用之前:

- task: DotNetCoreInstaller@0
  displayName: 'Install .net core 3.0 (preview)'
  inputs:
    packageType: 'sdk'
    version: '3.0.100-rc1-014190'

我测试了你的下载任务,效果很好

但是,您可以尝试使用新的安装程序任务
UseDotNet@2

- task: UseDotNet@2
  displayName: Install .NET Core 3.0 SDK
  inputs:
    packageType: 'sdk'
    version: '3.0.100'
更新:

为了使用.net3.0,您可能需要使用DotnetCoreClI任务来恢复、构建和测试您的项目,以下只是一个示例:

variables:
  solution: '**/*.sln'
  project: "**/*.csproj"
  buildPlatform: 'Any CPU'
  buildConfiguration: 'Release'

steps:
- task: UseDotNet@2
  displayName: Install .NET Core 3.0 SDK
  inputs:
    packageType: 'sdk'
    version: '3.0.100'

- task: DotNetCoreCLI@2
  inputs:
    command: 'restore'
    projects: '$(solution)'
    feedsToUse: 'select'
  displayName: Restore

- task: DotNetCoreCLI@2
  inputs:
    command: 'build'
    projects: '$(project)'
  displayName: Build

- task: DotNetCoreCLI@2
  inputs:
    command: 'test'
    projects: '$(project)'
  displayName: Test
谢谢你的回复

这对我有用,但有命令

  • 任务:UseDotNet@2
生成稍后在以下位置失败:

- task: NuGetCommand@2
  inputs:
    restoreSolution: '$(solution)'
游泳池是ubuntu

pool:
  vmImage: 'ubuntu-latest'

我对同一个问题感到震惊,但有不同的错误

这就是我执行powershell脚本的方式

$globaljson = '{"sdk": {"version": "3.0.100-preview3-010431"}}';
$globaljson | out-file $(Agent.ToolsDirectory)/dotnet2
这就是安装程序被调用的方式


不知道我在这里缺少了什么。

我更新了我的答案,出现此错误的原因可能是nuget命令使用其默认sdk编译项目。使用
DotNetCoreCLI@2
task,您的项目将使用最新版本的sdk进行编译。并且您的以下构建、测试任务也应该使用DotNetCoreCLI@2任务也是。
$globaljson = '{"sdk": {"version": "3.0.100-preview3-010431"}}';
$globaljson | out-file $(Agent.ToolsDirectory)/dotnet2