`Microsoft.NetCore.app` was not found in the Azure Build Pipeline

Anonymous
2022-06-25T05:56:55.943+00:00

Error is Microsoft.NetCore.App version 5.0 (x64) not found on the Azure Build Pipeline when upgraded .NET 3.1 to 6.0.

You can resolve the problem by installing the specified framework and/or SDK.

I come to know that to build .NET 5 Azure Functions, .NET Core 3 SDK is required.

In Similar, is .NET 5 SDK required to build .NET 6.0 Azure Functions in Azure Pipelines?

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
2,581 questions
No comments
{count} votes

Accepted answer
  1. Udaiappa Ramachandran 641 Reputation points Microsoft MVP
    2022-06-26T16:51:54.44+00:00

    I believe you have issues with your pipeline tasks, make sure agent is set to Windows 2022 for YAML

    pool:
    vmImage: 'windows-2022'

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

    steps:

    • task: NuGetToolInstaller@1
    • task: PowerShell@2
      inputs:
      targetType: 'inline'
      script: |
      $newBuildNumber = echo ($(PSVBUILDNUMBER)+$(PSVBUILDVERSION))
      ((Get-Content -path Directory.Build.props -Raw) -replace 'BUILD_NUMBER', $newBuildNumber) | Set-Content -Path Directory.Build.props
      workingDirectory: '$(Build.Repository.LocalPath)'
    • task: PowerShell@2
      inputs:
      targetType: 'inline'
      script: Get-Content -path Directory.Build.props -Raw
      workingDirectory: '$(Build.Repository.LocalPath)'
    • task: NuGetCommand@2
      inputs:
      restoreSolution: '$(solution)'
    • task: VSBuild@1
      inputs:
      solution: '$(solution)'
      msbuildArgs: '[YOUR BUILD ARGS]'
      platform: '$(buildPlatform)'
      configuration: '$(buildConfiguration)'
    • task: VSTest@2
      inputs:
      platform: '$(buildPlatform)'
      configuration: '$(buildConfiguration)'
    • task: CopyFiles@2
      displayName: 'Copying files'
      condition: and(succeeded(), true)
      inputs:
      Contents: '[PROJECT PATH]/bin/**'
      TargetFolder: '$(Build.ArtifactStagingDirectory)/[WHATEVER-PATH]'

    and if your pipeline uses GUI then set SDK to 6.0.102 or later version, please refer the screen shot
    215141-image.png

    No comments

0 additional answers

Sort by: Most helpful