.Net Core 3.1 not yet supported in Azure Pipelines hosted agents? Getting NETSDK1045

.Net Core 3.1 not yet supported in Azure Pipelines hosted agents?

No, Azure Pipelines hosted agents supports .Net Core 3.1, but the latest .net core 3.1.100 is not currently installed by default in the Azure Pipelines hosted agents.

You could check the Azure Pipelines Hosted Windows 2019 with VS2019 image, the default installed latest version of .net core is 3.0.100.

To use the .net core 3.1, you could add a Use .NET Core task to install the .net core 3.1.100:

enter image description here

enter image description here

Hope this helps.


Add a step to install .NET Core SDK before calling dotnet build.

steps:
- task: UseDotNet@2
  displayName: 'Install .NET Core sdk'
  inputs:
    packageType: sdk
    version: 3.1.100
    installationPath: $(Agent.ToolsDirectory)/dotnet

Working and verified with ubuntu-latest.